CompileProtege4InEclipse
Compile and Run Protege 4.0 Alpha from Eclipse
To follow is some documentation for compiling and running Protege 4.0 alpha 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.
Contents
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.
In the "New Project" dialog, choose Plug-in Project and click Next >.
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.
For the Plug-in Content section, uncheck both of the checkboxes in the Plug-in Options section and leave all other default settings.
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:
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:
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:
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
andorg.protege.common/lib
directories: