If your Eclipse-RCP application does not want to work with update site.
Join the DZone community and get the full member experience.Join For Free
I hope, that it saves someone sometime...
We are using Eclipse 3.6. Recently we had to make our RCP application automatically updatable via Eclipse update site, using p2 technology. First of all we were building new version of applications with buckminster, everything seemed to be working, utnil we realized, that plugins are not actually updated. I am not sure what was the reason of this behavior, but after spending some time trying to made it working, we had to refuse of building with buckminster.
Then we tried to build the new version of application with eclipse own functionality - "Eclipse product export wizard", which can be opened from .product file editor "Overview" page. Strangely, updating was failing with exceptions like
"Can't remove application_path/jre/jre/lib/charsets.jar"
or something similar. We found, that new version of application is always bundled with its own JRE
. When it updates current version, it tries to replace JRE in your application_path/jre with one from the updated version. Due to the fact, that your application JRE is in use (it might not be, I'll talk about this later), it can not remove some jars, and accordingly, failing.
Here comes some interesting part. It seems, that in Eclipse 3.6 the flag "Bundle JRE for this environment with this product" (on the .product editor "Launching" page) is somehow not considered and thus, even it is not set, your product is still bundled with JRE, that is why i always tries to updates it.
Now, to prevent application of failing with above-mentioned error. We found following trick: in your application.ini fail you have to provide alternative path to the JRE, by specifying
(Note: that new line have to be used between -vm and its argument).
If it is not provided, then by default Eclipse is looking for JRE in your product installation/JRE directory, if there is no javaw.exe and no -vm argument is pecified in .ini file, then it will fail with "No JRE can be found" error. If you will provide alternative path to JRE, in the runtime your application will be using this JRE and while updating it will still be updating JRE in your product installation folder.
Any feedback is greatly welcomed,
Opinions expressed by DZone contributors are their own.