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 commonComposite= createStyleTabContent(folder);
		Composite unusedComposite= createUnusedCodeTabContent(folder);
		Composite advancedComposite= createAdvancedTabContent(folder);
		
		Composite javadocComposite= createJavadocTabContent(folder);
		Composite complianceComposite= createComplianceTabContent(folder);
		Composite othersComposite= createBuildPathTabContent(folder);
		
		TabItem item= new TabItem(folder, SWT.NONE);
		item.setText(PreferencesMessages.getString("CompilerConfigurationBlock.common.tabtitle")); 
		item.setControl(commonComposite);
		item= new TabItem(folder, SWT.NONE);
		item.setText(PreferencesMessages.getString("CompilerConfigurationBlock.advanced.tabtitle")); 
		item.setControl(advancedComposite);
		item= new TabItem(folder, SWT.NONE);
		item.setText(PreferencesMessages.getString("CompilerConfigurationBlock.unused.tabtitle")); 
		item.setControl(unusedComposite);
		
		item= new TabItem(folder, SWT.NONE);
		item.setText(PreferencesMessages.getString("CompilerConfigurationBlock.javadoc.tabtitle")); 
		item.setControl(javadocComposite);
	
		item= new TabItem(folder, SWT.NONE);
		item.setText(PreferencesMessages.getString("CompilerConfigurationBlock.compliance.tabtitle")); 
		item.setControl(complianceComposite);
		
		item= new TabItem(folder, SWT.NONE);
		item.setText(PreferencesMessages.getString("CompilerConfigurationBlock.others.tabtitle")); 
		item.setControl(othersComposite);