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
};
		Composite compComposite= new Composite(folder, SWT.NULL);
		compComposite.setLayout(layout);
		int nColumns= 3;
		layout= new GridLayout();
		layout.numColumns= nColumns;
		Group group= new Group(compComposite, SWT.NONE);
		group.setText(PreferencesMessages.getString("CompilerConfigurationBlock.compliance.group.label")); 
		group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
		group.setLayout(layout);
	
		String label= PreferencesMessages.getString("CompilerConfigurationBlock.compiler_compliance.label"); 
		addComboBox(group, label, PREF_COMPLIANCE, values345, values345Labels, 0);	
		label= PreferencesMessages.getString("CompilerConfigurationBlock.default_settings.label"); 
		addCheckBox(group, label, INTR_DEFAULT_COMPLIANCE, new String[] { DEFAULT_CONF, USER_CONF }, 0);	
		int indent= fPixelConverter.convertWidthInCharsToPixels(2);
		Control[] otherChildren= group.getChildren();	
				
		String[] versions= new String[] { VERSION_1_1, VERSION_1_2, VERSION_1_3, VERSION_1_4, VERSION_1_5 };
		String[] versionsLabels= new String[] {
			PreferencesMessages.getString("CompilerConfigurationBlock.version11"),  
			PreferencesMessages.getString("CompilerConfigurationBlock.version12"), 
			PreferencesMessages.getString("CompilerConfigurationBlock.version13"), 
			PreferencesMessages.getString("CompilerConfigurationBlock.version14"), 
			PreferencesMessages.getString("CompilerConfigurationBlock.version15") 
		};
		
		label= PreferencesMessages.getString("CompilerConfigurationBlock.codegen_targetplatform.label"); 
		addComboBox(group, label, PREF_CODEGEN_TARGET_PLATFORM, versions, versionsLabels, indent);	
		label= PreferencesMessages.getString("CompilerConfigurationBlock.source_compatibility.label");