Taming Eclipse Helios RCP Apps on Windows 7
Recently I upgraded to Windows 7 which allows me to use the 64 Bit JRE. However, I spent 2 days to get a minimal RCP application to run. Here is the result.
First, do not mix up the JREs and the deployed RCP application. SWT exists for 32 Bit and for 64 Bit – use the appropriate version with your JDK. If you run a 64 Bit JDK, use the 64 Bit Eclipse Helios version, same with the 32 Bit versions. The deployed RCP application will also be 64 Bit and 32 Bit respectively, because the files are copied from the IDE during the deployment process. If you mix up between them you will run into errors like this:
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-05 13:59:28.417
!MESSAGE Bundle org.eclipse.swt.win32.win32.x86_64_3.6.0.v3650b [56] was not resolved.
!SUBENTRY 2 org.eclipse.swt.win32.win32.x86_64 2 0 2010-08-05 13:59:28.419
!MESSAGE Platform filter did not match: (& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86_64))
and/or this:
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.SWTError
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
But I found myself in a situation where even the correct version of the JRE (64 Bit in my case) didn’t work together with a deployed RCP application from a 64 Bit Helios IDE. The default launching arguments (which can be found on tab “Launching” in the product configuration) are set to:
-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -debug
Unfortunately the placeholder do not seem to be resolved during the deployment. Therefore they end up in the generated eclipse.ini, which looks like this:
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
–launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.0.v20100503
-os
${target.os}
-ws
${target.ws}
-arch
${target.arch}
-nl
${target.nl}
-consoleLog
-debug
-noexit
-vmargs
-Xms40m
-Xmx384m
The launch of the RCP application fails, obviously because a system architecture called “${target.arch}” does not exist. Setting the parameters manually resolved finally the problem – although it took me 2 days to figure out what the actual problem was. I suspect that this is a bug in Helios. Here’s what the eclipse.ini should look like:
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
–launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.0.v20100503
-os
win32
-ws
win32
-arch
x86_64
-consoleLog
-debug
-vmargs
-Xms40m
-Xmx384m
Simply omitting the operating system parameters will also work:
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
–launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.0.v20100503
-consoleLog
-debug
-vmargs
-Xms40m
-Xmx384m
