Bug 70284 [1.5] class file with "1.4 compatibility" cannot be run in Java 1.4
If I compile a simple class in Eclipse with the following compliance settings, it won't run in a 1.4 JVM. It appears the .class file relies on 1.5 libraries, despite the compatibility setting. Compiler compliance: 1.5 Generated .class compatibility: 1.4 Source compatibility: 1.5 Here's my source code: public class TestConcat { public static void main(String[] args) { String w = "world"; System.out.println("Hello " + w); } } The resulting exception: Exception in thread "main" java.lang.NoClassDefFoundError: java/lang/StringBuilder at TestConcat.main(TestConcat.java:13)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerConfigurationBlock.java
fComplianceStatus= validateCompliance();
				updateInlineJSREnableState();
			} else if (PREF_PB_MAX_PER_UNIT.equals(changedKey)) {
				fMaxNumberProblemsStatus= validateMaxNumberProblems();
			} else if (PREF_RESOURCE_FILTER.equals(changedKey)) {
				fResourceFilterStatus= validateResourceFilters();
			} else if (PREF_PB_UNUSED_PARAMETER.equals(changedKey) ||
					PREF_PB_DEPRECATION.equals(changedKey) ||
					PREF_PB_INVALID_JAVADOC.equals(changedKey) ||
					PREF_PB_MISSING_JAVADOC_TAGS.equals(changedKey) ||
					PREF_PB_MISSING_JAVADOC_COMMENTS.equals(changedKey) ||
					PREF_PB_LOCAL_VARIABLE_HIDING.equals(changedKey) ||
					PREF_JAVADOC_SUPPORT.equals(changedKey) ||
					PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION.equals(changedKey)) {				
				updateEnableStates();
			} else if (PREF_PB_SIGNAL_PARAMETER_IN_OVERRIDING.equals(changedKey)) {
				
				fWorkingValues.put(PREF_PB_SIGNAL_PARAMETER_IN_ABSTRACT, newValue);
			} else {
				return;
			}
		} else {
			updateEnableStates();
			updateComplianceEnableState();
			updateAssertAsIdentifierEnableState();
			updateInlineJSREnableState();
			fComplianceStatus= validateCompliance();
			fMaxNumberProblemsStatus= validateMaxNumberProblems();
			fResourceFilterStatus= validateResourceFilters();
		}