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
combo.setEnabled(enabled);
			
			if (!enabled) {
				String val= (String) fWorkingValues.get(PREF_PB_ASSERT_AS_IDENTIFIER);
				if (!ERROR.equals(val)) {
					fWorkingValues.put(PREF_PB_ASSERT_AS_IDENTIFIER, ERROR);
					updateCombo(combo);
					fRememberedUserCompliance[IDX_ASSERT_AS_IDENTIFIER]= val;
				}
			} else {
				String val= fRememberedUserCompliance[IDX_ASSERT_AS_IDENTIFIER];
				if (!ERROR.equals(val)) {
					fWorkingValues.put(PREF_PB_ASSERT_AS_IDENTIFIER, val);
					updateCombo(combo);
				}
			}
		}
	}
	
	private void updateInlineJSREnableState() {
		boolean enabled= !checkValue(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_5);
		Button checkBox= getCheckBox(PREF_CODEGEN_INLINE_JSR_BYTECODE);
		checkBox.setEnabled(enabled);
		
		if (!enabled) {
			String val= (String) fWorkingValues.get(PREF_CODEGEN_INLINE_JSR_BYTECODE);
			fRememberedUserCompliance[IDX_INLINE_JSR_BYTECODE]= val;
			
			if (!ENABLED.equals(val)) {
				fWorkingValues.put(PREF_CODEGEN_INLINE_JSR_BYTECODE, ENABLED);