Pages

Sunday, December 9, 2012

Headless RCP - standalone

Introduction

We have another blog on making a headless RCP (Headless RCP - simple). In this article, we make the program into a standalone desktop RCP application.

Procedure

You need to make a “Product Configuration”.

PastedGraphic18-2012-12-9-19-37.png

Select the application that we created before.

PastedGraphic20-2012-12-9-19-37.png

Setting the “Product Definition”.

PastedGraphic21-2012-12-9-19-37.png

Don’t setup anything in ID.

PastedGraphic22-2012-12-9-19-37.png

Update the MANIFEST.MF

Go to MANIFEST.MF, and you’ll see you already have an extension. Add property.

PastedGraphic23-2012-12-9-19-37.png

PastedGraphic24-2012-12-9-19-37.png

PastedGraphic25-2012-12-9-19-37.png

In Dependencies, you have to add the application you just created.

PastedGraphic27-2012-12-9-19-37.png

Then click “Add Required Plug-ins”.

PastedGraphic28-2012-12-9-19-37.png

You’ll see all the required plugins are added.

PastedGraphic29-2012-12-9-19-37.png

Click synchronize to check everything is OK.

PastedGraphic26-2012-12-9-19-37.png

And then, you need to add all “.” and all the namespaces additional to your exported one in the “Runtime/Classpath”. Without this configuration you’ll have errors when you launch the standalone program even when your program works fine within the eclipse IDE.

PastedGraphic2-2012-12-9-19-37.png

Exporting the headless RCP

PastedGraphic34-2012-12-9-19-37.png

PastedGraphic30-2012-12-9-19-37.png

PastedGraphic31-2012-12-9-19-37.png

You’ll see that the standalone headless RCP is created in the directory you specified.

PastedGraphic32-2012-12-9-19-37.png

Executing standalone headless RCP

For execution, you can run “/DIRECTORY_TO_THE_RCP/Eclipse.app/Contents/MacOS/eclipse -data WORK_SPACE -clean”. You can make the shell script. Check that it also has the “-clean” parameter.

PastedGraphic33-2012-12-9-19-37.png

Run Configuration

You can create a run configuration so that you can launch the product within eclipse IDE.

PastedGraphic35-2012-12-9-19-37.png

Add -clean parameter.

PastedGraphic36-2012-12-9-19-37.png

Add “Required Plug-ins”

PastedGraphic37-2012-12-9-19-37.png

You can run to get the same result.

PastedGraphic39-2012-12-9-19-37.png

PastedGraphic38-2012-12-9-19-37.png

After the first launch, you have the product in the run button.

PastedGraphic40-2012-12-9-19-37.png

Issues and solutions

  • It worked fine, but when you do something more and you suddenly have an error, the first thing you need to check is “Run Configurations”, then “Add Required Plug-ins”, PastedGraphic1-2012-12-9-19-37.png
  • Not found Activator
    • You may have “org.osgi.framework.BundleException: The activator ABC.Activator for bundle ABC.refactorer is invalid” error when you launch the standalone binary. In that case, add “.” in the runtime class path.PastedGraphic-2012-12-9-19-37.png

References

No comments:

Post a Comment