Eclipse Development

This page helps Java developers to get started developing Nepomuk Components using the Eclipse IDE. Note that there are three differnt ways to program, each requiring a different setup. After reading it, you can continue on the related pages:

If you have troubles, if you have worries:

Getting started with Eclipse for Nepomuk

You need

  • Eclipse 3.2 (or higher, such as 3.3)
  • Subversion plugin for Eclipse
  • Java 1.5

Developing PSEW (DFKI Version)

Use these SVN locations:

If you want to develop for PSEW (DFKI reduced version), do this:

* Create a new eclipse workspace and import the needed projects

  • Start Eclipse and create a new workspace (you must use a separate workspace for PSEW)
  • ATTENTION: WINDOWS USERS MUST USE A SHORT WORKSPACE PATH! Use C:\nepomuk or similar, because if not, you will not be able to check out NEPOMUK because of filename length restrictions under windows!!! The project contains very long filenames in nested folder structures, use a short workspace folder.
  • In the Eclipse IDE choose File -> Import -> Team -> Team project set
  • Set the file name to the previously downloaded .psf file
  • Click finish.
  • If you can't import it because you have a different Subversion client: look into the .psf file and checkout the projects yourself.
  • If you can't import them because of "access denied" ("Error getting dir list") because its HTTPS security, change all SVN URIs to HTTP.

After these steps, you should have 8 projects in your workspace that are needed for building and running PSEW. They are:

  • EclipseTargetPlatform2.0
  • org.semanticdesktop.nepomuk.psew
  • org.semanticdesktop.nepomuk.psew.core
  • org.semanticdesktop.nepomuk.psew.datawrapper
  • org.semanticdesktop.nepomuk.psew.explorer
  • org.semanticdesktop.nepomuk.psew.ontologyexplorer
  • org.semanticdesktop.nepomuk.psew.pimo
  • org.semanticdesktop.nepomuk.psew.product

Now you need to configure Eclipse to the JAR files contained in the downloaded plugins as "target platform".

  • Open the file "psew.target" in the EclipseTargetPlatform2.0 project and choose "Set as target platform" in the upper right corner in the editor. This will reset your Eclipse development environment to "cross compile" for our Nepomuk version of eclipse.

To verify if this worked, you can go to the settings, see the plugin-development settings for the target platform and check if it looks something like this (for linux users: this is a windows screenshot, adapt the paths to your real workspace):

To Start PSEW in developer mode:

  • Open the file "PSEWCompleteProduct.product" in the org.semanticdesktop.nepomuk.psew.product project, choose "Synchronize" and then "Launch eclipse application" in the bottom left part of the window.
  • You should have PSEW up and running.

When you start NEPOMUK this way, it will store its data into the workspace of the run target (= in a developer version of nepomuk). It will still store .lock files into your home directory, but will not access your personal semantic desktop data. To change that, see DataFolder#WhenDevelopingNEPOMUK

Developing NEPOMUK Server (headless)

If you program on the common Nepomuk platform, add this SVN repository URL to Eclipse:

To develop the headless (user-interface-less) version, you need to check out two projects from SVN:

  • org.semanticdesktop.nepomuk.server.product
  • EclipseTargetPlatform2.0

Then you have to set the the Eclipse Target Platform to run and develop Nepomuk: EclipseTargetPlatform2.0 contains a complete installation of the Nepomuk Java components, it is a collection of OSGI bundles.

Target platform bundles are put into different folders:

  • eclipse32 - Eclipse 3.2 platform itself.
  • external - external dependencies, i.e. libraries that Nepomuk project uses without any modifications.
  • shared - common Nepomuk components.
  • server - Nepomuk components specific for server side.
  • client - Nepomuk components specific for client (PSEW) side.

Three pre-selected sets are provided:

  • server.target - include eclipse32, external, shared and server bundles. Use it for Nepomuk server development.
  • client.target - include eclipse32, external, shared and client bundles. Use it for PSEW development.
  • client-host.target - same as client.target, but using Eclipse platform provided with Eclipse IDE instead of bundles from Nepomuk SVN.

You now need to set Eclipse to use this platform for development and running Nepomuk.

In EclipseTargetPlatform2.0 project, double-click on server.target file, and then click on Make this target the current target platform:

Alternatively, you can go to Window > Preferences window, select Plug-in development > Target Platform. Specify location of target platform, for example EclipseTargetPlatform2.0/server/eclipse, and click Reload.

If target platform is changed later (for example, after updating from SVN), just go to the same configuration window and click Reload.

Start Nepomuk-OSGI

You should have now two projects in your workspace, and have the Eclipse TargetPlatform set to the right place. now start Nepomuk by

  • double-click on the org.semanticdesktop.nepomuk.server.product file in the project of the same name
  • click on Launch the product

Interact with Nepomuk-OSGI services

The console will show the OSGI console, something like this:

osgi> .... starting this and that ....
osgi>

If only the osgi> prompt shows up and no further initialization happens, check paths in the ETP2.0 project.

Enter some wise commands and see what happens:

osgi>start org.semanticdesktop.nepomuk.comp.rdfrepository
osgi>help
osgi>bundles

To see the SOAP services, go to this address in your webbrowser. If the XFIRE service started correctly, it will show you all registered SOAP objects and their WSDL files.

Stopping Nepomuk-OSGI

go to the OSGI console and type this, to safely shutdown the OSGI runtime and close all services appropriately. System.exit() is bad for you.

osgi>close

If you want to change individual components you can checkout the bundles as projects, these will then take precedence over the bundles in the TargetPlatform (if not, check the right boxes on the plugins tab of the run menu!)

Guides

No you can continue with the multuple EclipseDevelopmentGuides.

Once you have Eclipse working, go back to the NepomukTutorial to learn about how to program with the services, fix bugs, create JSP pages, or develop your own services.

Problems and Fixes

Moved to separate wiki-page at EclipseDevelopmentProblemsAndFixes

Attachments