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
addComboBox(composite, label, PREF_15_PB_UNSAVE_TYPE_OPERATION, errorWarningIgnore, errorWarningIgnoreLabels, 0);
		label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_final_param_bound.label"); 
		addComboBox(composite, label, PREF_15_PB_FINAL_PARAM_BOUND, errorWarningIgnore, errorWarningIgnoreLabels, 0);
		return composite;
	}
	
	
		
	
	/* (non-javadoc)
	 * Update fields and validate.
	 * @param changedKey Key that changed, or null, if all changed.
	 */	
	protected void validateSettings(String changedKey, String newValue) {
		
		if (changedKey != null) {
			if (INTR_DEFAULT_COMPLIANCE.equals(changedKey)) {
				updateComplianceEnableState();
				updateComplianceDefaultSettings(true);
				fComplianceStatus= validateCompliance();
			} else if (PREF_COMPLIANCE.equals(changedKey)) {
				if (checkValue(INTR_DEFAULT_COMPLIANCE, DEFAULT_CONF)) {
					updateComplianceDefaultSettings(false);
				}
				fComplianceStatus= validateCompliance();
			} else if (PREF_SOURCE_COMPATIBILITY.equals(changedKey)) {
				updateAssertAsIdentifierEnableState();
				fComplianceStatus= validateCompliance();
			} else if (PREF_CODEGEN_TARGET_PLATFORM.equals(changedKey) ||
					PREF_PB_ASSERT_AS_IDENTIFIER.equals(changedKey)) {