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.build_clean_outputfolder.label"); 
		addCheckBox(othersComposite, label, PREF_BUILD_CLEAN_OUTPUT_FOLDER, cleanIgnoreValues, 0);
		label= PreferencesMessages.getString("CompilerConfigurationBlock.enable_exclusion_patterns.label"); 
		addCheckBox(othersComposite, label, PREF_ENABLE_EXCLUSION_PATTERNS, enableDisableValues, 0);
		label= PreferencesMessages.getString("CompilerConfigurationBlock.enable_multiple_outputlocations.label"); 
		addCheckBox(othersComposite, label, PREF_ENABLE_MULTIPLE_OUTPUT_LOCATIONS, enableDisableValues, 0);
				
		label= PreferencesMessages.getString("CompilerConfigurationBlock.resource_filter.label"); 
		Text text= addTextField(othersComposite, label, PREF_RESOURCE_FILTER, 0, 0);
		gd= (GridData) text.getLayoutData();
		gd.grabExcessHorizontalSpace= true;
		gd.widthHint= fPixelConverter.convertWidthInCharsToPixels(10);
		description= new Label(othersComposite, SWT.WRAP);
		description.setText(PreferencesMessages.getString("CompilerConfigurationBlock.resource_filter.description")); 
		gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
		gd.horizontalSpan= nColumns;
		gd.widthHint= fPixelConverter.convertWidthInCharsToPixels(60);
		description.setLayoutData(gd);
		
		return othersComposite;
	}
	
	private Composite createComplianceTabContent(Composite folder) {
		GridLayout layout= new GridLayout();
		layout.numColumns= 1;
		String[] values345= new String[] { VERSION_1_3, VERSION_1_4, VERSION_1_5 };
		String[] values345Labels= new String[] {
			PreferencesMessages.getString("CompilerConfigurationBlock.version13"),  
			PreferencesMessages.getString("CompilerConfigurationBlock.version14"), 
			PreferencesMessages.getString("CompilerConfigurationBlock.version15")