plugins disappear…

Eclipse 3.3 runs with Java 1.4 but recommended is Java 5. Every customer is different for us. Not every time is Java 5 or the current Java 6 the JRE for development / production. These technical requirements are not fix for all time. So i adjust my laptop settings when i start to work for a new customer. Under Windows is the PATH environment variable responsible to define which JRE is executed when you run a java application like the eclipse ide or ANT. It contains the bin folder of the JDK/JRE. If not defined then the java.exe in %SYTEMROOT%\system32 (e.g. C:\windows\system32) check the windows registry:

HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment -> CurrentVersion (e.g. value 1.6)

For a quick check i open a dos shell via entering “cmd” in the execute textfield of windows and type “java -version”:

java version “1.4.2_16”

Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_16-b05)

Java HotSpot(TM) Client VM (build 1.4.2_16-b05, mixed mode)

These recommendation for Java 5 as runtime are valid as well for the plugins. Eclipse plugins define in the META-INF/MANIFEST file which runtime is minimum required:

Bundle-RequiredExecutionEnvironment: J2SE-1.5

The plugin with such a definition will not be activated during start up if the workbench jre does not fit the requirement. So far so good. I start a new workspace. Changed the workspace path to a new folder during startup. Eclipse looks ok on the first look but after a while you miss some functions. Lucky if some error dialogs pops up. You see normally only in the error log exception stacktraces containing lines with

java.lang.UnsupportedClassVersionError: …

The good thing is that eclipse can be configured to work in such conditions. Eclipse has command line arguments to define the workbench jre. So you have under windows to create a new link on the desktop to the eclipse.exe. Under options of this link is the full path to the eclipse.exe. Just add after a white space e.g. the following corresponding to your environment and paths:

-vm C:\java\jdk1.6\bin\javaw.exe -vmargs -XX:MaxPermSize=128m -XX:PermSize=128m -Xmx768M -Xms768M -Dsun.lang.ClassLoader.allowArraySyntax=true

This defines the workbench vm (-vm), vm arguments (-vmargs) like memory settings (-XX…) and a system property (-Dkey=value) e.g. to work properly with the bea plugin.

With these changed settings eclipse can start all plugins as expected. Functions, perspectives,.. formerly hidden appear in the workbench. No Magic but a little bit more messages in the ide would be nice for users… In the preferences of eclipse can under Java -> Installed JRE the default JRE be defined. Each project can define under project properties -> Java compiler -> compiler compliance level e.g. 1.4. So run ant inside a dos box to compile with java 1.4 (as defined for windows), start eclipse with java 6 and compile the project inside eclipse with 1.4. Very flexible but you need to know where to put the screw driver on.