Difference between revisions of "CompileProtege4InEclipse"
(→Creating a Runnable for Windows or Linux) |
|||
Line 27: | Line 27: | ||
as I can tell Mac users cannot get the following steps to work. It is possible | as I can tell Mac users cannot get the following steps to work. It is possible | ||
that this does work on intel macs but I have not been able to test this. | that this does work on intel macs but I have not been able to test this. | ||
− | There are claims made on the web saying that this issue is solved. | + | There are claims made on the [http://www.eclipse.org/swt/faq.php#swtawtosx web] saying that this issue is solved. |
− | + | [SwingSwtProblems] is my current status on this issue. Mac users need to | |
use an [[#Creating_a_Runnable_for_OS_X| alternative method]]. | use an [[#Creating_a_Runnable_for_OS_X| alternative method]]. | ||
Revision as of 13:00, February 4, 2009
Compile and run the Protege 4 OWL editor from Eclipse
This document is in progress. While it is not fully documented yet it does represent the recommended way to set up a protege 4 environment in eclipse. If this documentation is insufficient the fall back is to go to the generic ide instructions.
- Download the protege plug-ins with linked source. Currently these can be found here but soon there will be a standard download page connected to each of our releases.
- Create a new eclipse workspace
- Click "File -> Import..." This will bring up a dialog box.
- Choose "Plug-in Development -> Plug-ins and Fragments" and click "Next". This will bring up a dialog box.
- Unselect "The target platform (as specified in the Preferences)"
- Click the browse button and browse to the directory where you downloaded the protege plug-ins with linked source
- Don't worry about the warning at the top of the dialog box. The "Plug-ins and Fragments to Import" box should say "Select from all plug-ins..." and the "Import As" box should say "Binary projects".
- Click next bringing up a new dialog box.
- Click "Add All".
- Click "Finish"
This is a milestone. You should now see the Protege bundles as imported Plug-in projects.
Creating a Runnable for Windows or Linux
We now need to create a runnable. As far as I can tell Mac users cannot get the following steps to work. It is possible that this does work on intel macs but I have not been able to test this. There are claims made on the web saying that this issue is solved. [SwingSwtProblems] is my current status on this issue. Mac users need to use an alternative method.
Windows and Linux users now do the following to make a runnable.
- Click "Run -> Debug Configurations". This will bring up a dialog box.
- Select "OSGi Framework" and click the "New" Icon at the top.
- Name the "New_Configuration" something useful like "Protege".
- In the Bundles box, scroll down to where it says "Target Platform". Unselect all the bundles from the target platform (one click to the left of "Target Platform")
- Click on "Add Required Bundles".
- Click "Apply" to save your changes.
- Click "Debug" and Protege should come up.
Windows and Linux users should now be able to easily use eclipse to develop their plug-ins. To start a new bundle just create a new Eclipse Plug-in project. These projects will automatically get attached to the Protege runnable.
Creating a Runnable for OS X
OS X users have to work a bit harder to get a working runnable. I have figured out the following workaround but am looking for a better way. First, checkout the ide project as a general project from svn at http://smi-protege.stanford.edu/repos/protege/protege4/small-projects/ide/trunk. In the following instructions I assume that it is checked out as the project "ide". Now the runnable can be created with the following steps:
- Click "Run -> Debug Configurations". A dialog box will come up.
- Select "Java Application" and click the "New" button at the top.
- Change the name of the "New_Configuration" to something more meaningful.
- Select the "Main" tab and
- Change the "Main Class" to be org.eclipse.core.runtime.adaptor.EclipseStarter.
- Select the "Arguments" tab and
- Set the working directory to ${workspace_loc:ide}.
- Add the following -D options to the "VM arguments" box:
- -Dorg.protege.plugin.extra.0=${workspace_loc:com.owldl.pellet}
- -Dorg.protege.plugin.extra.1=${workspace_loc:org.coode.dlquery}
- -Dorg.protege.plugin.extra.2=${workspace_loc:org.coode.owlviz}
- -Dorg.protege.plugin.extra.3=${workspace_loc:org.protege.editor.core.application}
- -Dorg.protege.plugin.extra.4=${workspace_loc:org.protege.editor.owl}
- -Dorg.protege.plugin.extra.5=${workspace_loc:org.semanticweb.owl.owlapi}
- Select the "Classpath" tab and
- Add ide/org.eclipse.osgi.jar as a jar to the class path.
- Click "Apply" to save your changes
- Click "Debug" to run the runnable.
At this point, mac users can create Eclipse Plug-in projects to create their own plug-ins. In order to run these plugins the develoeper can add a new org.protege.plugin.extra line and create a staged location for the plugin as described in CompileProtege4PluginInEclipseOneProject#Running_the_Plugin.