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
label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_special_param_hiding.label"); 
		addCheckBox(composite, label, PREF_PB_SPECIAL_PARAMETER_HIDING_FIELD, enabledDisabled, indent);
		label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_field_hiding.label"); 
		addComboBox(composite, label, PREF_PB_FIELD_HIDING, errorWarningIgnore, errorWarningIgnoreLabels, 0);
		label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_incompatible_interface_method.label"); 
		addComboBox(composite, label, PREF_PB_INCOMPATIBLE_INTERFACE_METHOD, errorWarningIgnore, errorWarningIgnoreLabels, 0);
		label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_char_array_in_concat.label"); 
		addComboBox(composite, label, PREF_PB_CHAR_ARRAY_IN_CONCAT, errorWarningIgnore, errorWarningIgnoreLabels, 0);
		
		label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_deprecation.label"); 
		addComboBox(composite, label, PREF_PB_DEPRECATION, errorWarningIgnore, errorWarningIgnoreLabels, 0);
		label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_deprecation_in_deprecation.label"); 
		addCheckBox(composite, label, PREF_PB_DEPRECATION_IN_DEPRECATED_CODE, enabledDisabled, indent);		
	
		label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_deprecation_when_overriding.label"); 
		addCheckBox(composite, label, PREF_PB_DEPRECATION_WHEN_OVERRIDING, enabledDisabled, indent);
		
		label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_non_externalized_strings.label"); 
		addComboBox(composite, label, PREF_PB_NON_EXTERNALIZED_STRINGS, errorWarningIgnore, errorWarningIgnoreLabels, 0);
		
		gd= new GridData();
		gd.widthHint= fPixelConverter.convertWidthInCharsToPixels(6);
		
		label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_max_per_unit.label"); 
		Text text= addTextField(composite, label, PREF_PB_MAX_PER_UNIT, 0, 0);
		text.setTextLimit(6);
		text.setLayoutData(gd);
		return composite;
	}
	private Composite createUnusedCodeTabContent(TabFolder folder) {