CompileProtege4InIntelliJ

From Protege Wiki
Revision as of 14:49, April 6, 2010 by Tredmond (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

THIS PAGE IS NOW OUTDATED.

Setup and Run P4.x in IntelliJ


This page describes the simple steps required to setup P4.x for development in jetbrains IntelliJ.


Back to Protege4DevDocs



Check out sources

Use an SVN client to checkout the Protege 4 trunk from SVN to a local directory (say trunk).

   svn co https://smi-protege.stanford.edu/repos/protege/protege4/protege-standalone/trunk/ trunk

If using IntelliJ to checkout the sources and it prompts you to create a new project, select No.

Create the IntelliJ project files

Matthew Horridge has created a very easy to use tool to create a nice tidy intelliJ project. You can download this from here.

  • Open a command line
  • Change directory into trunk
   cd trunk
  • Run the command line tool (notice the current path - dot - is a parameter)
   java -jar Protege4IntelliJProjectBuilder.jar .
  • Open the project in IntelliJ

You should now have a multi-module project containing the various pieces of the core and owl editor, as well as several plugins that are part of the default distribution (DL Query, OWLViz, pellet and FaCT++)

Building

Build the project the usual way. Some versions of IntelliJ may complain that the directory could not be created. Just try again and it should be built.

Build products are placed into the build/dist/equinox directory, which is in the Protege trunk directory.

Running

You can add a run configuration by specifying the following settings:

 Main class: org.eclipse.core.runtime.adaptor.EclipseStarter
 VM parameters: -Dosgi.clean=true
 Working directory: <PATH TO PROTEGE TRUNK>/build/dist/equinox
 Use classpath and JDK of module: runtime

See the screen shot below. It is particularly important that the working directory is set to be the equinox build directory and that the class path and JDK module be set to runtime.

RunP4inIntelliJ.png


Troubleshooting

On running, if you have errors in your log window, check that a logs/ directory exists in the equinox directory. If not, create an empty one.

Also, log4j.xml should exist in the equinox directory. If it does not then copy it from the root of your source directory.