Somehow, it was a good decision to switch OpenChrom to Eclipse 3.7.1 (Indigo) and Java7 except of Mac 10.6.3 “Snow Leopard”. Why on earth do they not support Java7? I don’t know. But I was aware of, that I needed a quick workaround to make it running.
Hence, here’s my solution how to start RCP applications on Mac OS X using Java7:
First of all, create the folder “JavaVirtualMachines” in the directory “/Library/Java“. Unless it’s not created, you’re not able to install the Java7 Developer Preview.
user$ sudo mkdir /Library/Java/JavaVirtualMachines
Install it by dragging it into the specified folder.
Now, we need to create a program specific launcher called “start.sh“, but you’re free to choose nearby any name you like. Therefore we dive into the application.app (in this case openchrom.app).
Create a file called “start.sh“.
The content of the starter “start.sh” depends on the specific settings of your RCP application. I took the settings from the application.ini file (in this case openchrom.ini).
#!/bin/sh export JAVA_HOME=/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home LAUNCHER_JAR=../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar java \ -Xms128M \ -Xmx500M \ -Dosgi.install.area.readOnly \ -Dosgi.email@example.com/.openchrom/0.6.0/OpenChrom/configuration \ -Dosgi.firstname.lastname@example.org/OpenChrom/workspace \ -Dsun.awt.xembedserver=true \ -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts \ -jar $LAUNCHER_JAR
Start the terminal and navigate to the “start.sh” script. It is necessary to set the executable bit once using “chmod a+x“. The RCP application can now be started by starting the script using “./start.sh“.
user$ cd Desktop/0.6.0-PREV/OpenChrom/openchrom.app/Contents/MacOS/ user$ chmod a+x start.sh user$ ./start.sh
This tutorial presented a workaround for OpenChrom. But it is applicable in the same way for Eclipse and other RCP applications.