Showing posts with label export. Show all posts
Showing posts with label export. Show all posts

Feb 6, 2008

Feature based configuration of an RCP application

For a RCP application, I started with plugins based product configuration. When I reached a point where I need to provide software updates thru an update site, I needed a feature based product configuration. I thought should be as simple as selecting the features check box and adding the feature. But I spent around two whole days googling and debugging to bring it up and running. I think everyone would have gone thru the phase. I thought I'll write a blog entry on the issues, but I was lazy to draft such a long post. Yesterday Jan Kohnert sent a nice mail on his experience to the news group. Instead of copy-pasting the whole thing here, I present the information with little modifications. Thanks Jan.

  • Open your product file and select features in the Overview tab:


  • In the Configuration tab, click "New Feature...", and create the new feature:

  • In the newly created feature, go to the included features tab and add "org.eclipse.rcp" feature:
  • Go to the plugins tab and add your product's plugins
  • RCP feature has most of the plugins that you would require. However if you use anything other plugins (core.resources, ui.forms, etc), you need to add those plugins to the feature:
At this point you should be successfully running your RCP application. If you are not interesting in providing support for Software Updates for your app, you should be fine with this.

Ideally, even for software updates, this should work fine. However, if you try to create an update site and try running software update, you will be hitting the java.lang.SecurityException: "Invalid signature file digest for Manifest main attributes". To get rid of that, remove the RCP feature from the included features list of your feature and add the plugins in RCP feature to your feature. Thanks to PDE team, copy-pasting works in the plugins tab of Feature Editor :-)



While going thru the update stuff, I realized that the update will not function as expected if we launch it from the IDE (Not sure of why). So I have to export the product and run from the disk, which means I can't debug and step thru the code :-( To know what happens during the update, I start the application with -debug options and add these lines in the .options file:

org.eclipse.update.core/debug=true
org.eclipse.update.core/debug/warning=true
org.eclipse.update.core/debug/parsing=true
org.eclipse.update.core/debug/install=true
org.eclipse.update.core/debug/configuration=true
org.eclipse.update.core/debug/type=true
org.eclipse.update.core/debug/web=true
org.eclipse.update.core/debug/installhandler=true
org.eclipse.update.core/debug/reconciler=true


Click here for more info on the .options

Jan 10, 2008

Deploying RCP along with JRE

When you distribute your RCP application you never know whether the end user will have a JVM installed in his machine or not. Even if he has a JVM, there are a good number of possibilities that it will be an older version. A simple solution to this problem is to bundle and ship a JRE along with your product and make the product to use that JRE. Eclipse provides a easier way to do it. In the Launching tab of your product editor, select the JRE you want to bundle. Save the file and export the product.



You are done :-)

Its good to have an installer without the JRE as well, because for those who have the required JRE, it will help in the download size

Exporting Jar - the easy way

There might be times where you want to create the same Jar file again and again. You don't have to run the Jar Export wizard every time you run the wizard. You can save the description of the Jar Export in the workspace and just right click to create the Jar. Here is what you need to do:

  • In the first page, check the Overwrite existing files without warning (This is optional, but if you are frequently creating the jar, this helps you saving from the little annoying dialog)


  • In the second page of Jar Export Wizard, check "Save the description of this JAR" and give the location to save


  • The next time you want to create the jar, just right click the *.jardesc file and select "Create Jar"
One problem with this Jar Export Wizard is that it was designed to export Jars outside workspace. This forces the jar description file is hardcoded with the destination, which means you can't share this jardesc file with your teammates (unless they want the jar exactly in the same location in their local disks) In case you are interested in exporting to a jar inside the workspace or exporting to a relative location, vote for this bug.