Project: JDT
Bug 152384 [preferences] Compilance level changes from 1.4 to 5.0 unexpectedly
Reported: 2006-07-31 18:19:41 | Status: verified fixed

I have this java on my machine: -- 1.4.2_05 -- 1.4.2_09 -- 1.5.0_07 Bring up Eclipse 3.2 with a new workspace. From the Eclipse menu, select Window->Preferences. Expand Java, select Compiler. In my case, the "Compiler compliance level" has 1.4 selected by default. Still under Java, select Installed JREs. The only thing showing for me at this point is jre1.5.0_07, and it is selected to be the default. Click on Add. Type this in the JRE name field: JRE 1.4.2_09 (or 1.4.2_05 if you have that). Click on the Browse button and locate 1.4.2_09. Mine was under my C: directory. OK. OK. Select JRE 1.4.2_09 to be the default Installed JRE. OK out of the Preferences dialog. You may get a prompt that the compiler settings have changed and a full build is required. If so, select Yes. Select Window->Preferences again. Expand Java, and select Compiler again. Now the compliance level shows 5.0 by default. If you reselect 1.4, it seems to stick this time. The problem is that since you wanted it to use the 1.4 VM any attempts to run after it changed the compiler to 1.5 will cause incompatible class file errors.

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompliancePreferencePage.java