Difference between revisions of "CompileProtege4InEclipse"

From Protege Wiki
Jump to: navigation, search
(incremental save of new content)
(incremental save of new content)
Line 1: Line 1:
<span style="font-size:22px; font-weight:bold; color:#DC7317;">Compile and Run Protege 4.0 Alpha from Eclipse</span>
+
<span style="font-size:22px; font-weight:bold; color:#DC7317;">Compile and run the Protege-OWL editor (4.0 alpha) from Eclipse</span>
 
<br /><br />
 
<br /><br />
  
To follow is some documentation for compiling and running Protege 4.0 alpha from the [http://www.eclipse.org/ Eclipse development environment].  This documentation takes the approach of creating a '''separate Eclipse project for each OSGi bundle''' in the Protege 4 source tree.
+
To follow are instructions for compiling and running the 4.0 alpha version of the [http://protege.stanford.edu/overview/protege-owl.html Protege-OWL editor] from the [http://www.eclipse.org/ Eclipse development environment].  This documentation takes the approach of creating a '''separate Eclipse project for each OSGi bundle''' in the Protege 4 source tree.
  
 
Please note that:
 
Please note that:
Line 99: Line 99:
 
[[Image:Owleditor-build-path.jpg]]<br /><br />
 
[[Image:Owleditor-build-path.jpg]]<br /><br />
  
* Click OK and the project will now build successfully.
+
* Click OK and the project will now build successfully. You have now created and configured projects for the minimum number of OSGi bundles necessary to run the Protege-OWL editor.
 +
 
 +
== Create a Run configuration ==

Revision as of 16:27, October 18, 2007

Compile and run the Protege-OWL editor (4.0 alpha) from Eclipse

To follow are instructions for compiling and running the 4.0 alpha version of the Protege-OWL editor from the Eclipse development environment. This documentation takes the approach of creating a separate Eclipse project for each OSGi bundle in the Protege 4 source tree.

Please note that:

  • These instructions are only valid for the 4.0 alpha version of Protege. If you want to compile and run the 3.x versions of Protege, we have separate instructions available elsewhere.
  • This is only one of several possible ways of compiling and running Protege 4 from Eclipse. This particular page is not meant to be exhaustive.

Create the org.protege.common project

Go to the SVN Repository Exploring perspective and navigate to protege4/protege-standalone/trunk/plugins/org.protege.common. This step assumes that you have Subversion support installed for the Eclipse IDE and that you have already connected to the Protege Subversion repository. If you have not done this, we have instructions for doing so on our Wiki.

Right-click on the org.protege.common folder and choose Checkout... In the resulting "Checkout from SVN" dialog, leave all of the default settings (as shown below) and click Finish.

Checkout-dialog.jpg

In the "New Project" dialog, choose Plug-in Project and click Next >.

New-project-dialog.jpg

In the "New Plug-in Project" dialog, type org.protege.common in the Project name text box. Leave the default settings in the Project Settings and Target Platform sections. For this documentation, we will also use the default location for the project. Click the Next > button.

New-plugin-project-dialog.jpg

For the Plug-in Content section, uncheck both of the checkboxes in the Plug-in Options section and leave all other default settings.

Plugin-content-dialog2.jpg

If you are curious about what any of these settings mean, you can click the question mark (help) icon in the lower-left corner of the New Project Plug-in dialog and browse the Eclipse documentation.

Click the Finish button. At this point, Eclipse will ask you if you want to use the Plug-in Development perspective for your project:

Associated-perspective-dialog.jpg

Check the "Remember my decision" checkbox and click the Yes button. Then, click OK on the "Confirm Overwrite" dialog. Eclipse will now begin checking out the source code for the org.protege.common bundle. Your Package Explorer will look something like the following after the checkout is complete:

Protege-common-explorer.jpg

If you have Project | Build Automatically turned on, you will notice compiler errors after checking out the source code. To fix them, right-click on the org.protege.common project and bring up the Properties dialog. Go to the Libraries tab in the Java Build Path section. Click the Add Jars... button and add all the JAR files that are in the org.protege.common/lib directory:

Protege-common-build-path.jpg

The project will now build successfully. The steps for creating projects for the remaining three bundles are largely the same.

Create the org.protege.editor.core.application project

To create a project for the org.protege.editor.core.application bundle:

  • Right-click on the protege4/protege-standalone/trunk/plugins/org.protege.editor.core.application folder in the SVN Repository Exploring perspective and choose Checkout...
  • Click Finish on the Checkout from SVN dialog without changing any of the default settings.
  • Choose Plug-in Project in the New Project dialog and click Next >.
  • Enter org.protege.editor.core.application in the Project name text box and click Next >.
  • Uncheck both checkboxes in the the Plug-in Options section and click Finish.
  • Click OK on the Confirm Overwrite dialog.
  • After the checkout completes, right-click on the org.protege.editor.core.application project in the Package Explorer and bring up the Properties dialog.
  • On the Libraries tab in the Java Build Path section, click the Add Jars... button.
  • Add all of the JAR files from the org.protege.editor.core.application/lib and org.protege.common/lib directories:

Core-application-build-path.jpg

  • Click OK and the project will now build successfully.

Create the org.semanticweb.owl.owlapi project

To create a project for the org.semanticweb.owl.owlapi bundle:

  • Right-click on the protege4/protege-standalone/trunk/plugins/org.semanticweb.owl.owlapi folder in the SVN Repository Exploring perspective and choose Checkout...
  • Click Finish on the Checkout from SVN dialog without changing any of the default settings.
  • Choose Plug-in Project in the New Project dialog and click Next >.
  • Enter org.semanticweb.owl.owlapi in the Project name text box and click Next >.
  • Uncheck both checkboxes in the the Plug-in Options section and click Finish.
  • Click OK on the Confirm Overwrite dialog.
  • After the checkout completes, right-click on the org.semanticweb.owl.owlapi project in the Package Explorer and bring up the Properties dialog.
  • On the Libraries tab in the Java Build Path section, click the Add Jars... button.
  • Add all of the JAR files from the org.semanticweb.owl.owlapi/lib directory:

Owlapi-build-path.jpg

  • Click OK and the project will now build successfully.

Create the org.protege.editor.owl project

To create a project for the org.protege.editor.owl bundle:

  • Right-click on the protege4/protege-standalone/trunk/plugins/org.protege.editor.owl folder in the SVN Repository Exploring perspective and choose Checkout...
  • Click Finish on the Checkout from SVN dialog without changing any of the default settings.
  • Choose Plug-in Project in the New Project dialog and click Next >.
  • Enter org.protege.editor.owl in the Project name text box and click Next >.
  • Uncheck both checkboxes in the the Plug-in Options section and click Finish.
  • Click OK on the Confirm Overwrite dialog.
  • After the checkout completes, right-click on the org.protege.editor.owl project in the Package Explorer and bring up the Properties dialog.
  • On the Libraries tab in the Java Build Path section, click the Add Jars... button.
  • Add all of the JAR files from the following directories:
    • org.protege.editor.owl/lib
    • org.semanticweb.owl.owlapi/lib
    • org.protege.editor.core.application/lib
    • org.protege.common/lib

Owleditor-build-path.jpg

  • Click OK and the project will now build successfully. You have now created and configured projects for the minimum number of OSGi bundles necessary to run the Protege-OWL editor.

Create a Run configuration