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
private static final String USER_CONF= "user";	 
	private ArrayList fComplianceControls;
	private PixelConverter fPixelConverter;
	private Composite fJavadocComposite;
	
	private String[] fRememberedUserCompliance;
	
	private static final int IDX_ASSERT_AS_IDENTIFIER= 0;
	private static final int IDX_SOURCE_COMPATIBILITY= 1;
	private static final int IDX_CODEGEN_TARGET_PLATFORM= 2;
	private static final int IDX_COMPLIANCE= 3;
	private static final int IDX_INLINE_JSR_BYTECODE= 4;
	private IStatus fComplianceStatus, fMaxNumberProblemsStatus, fResourceFilterStatus;
	public CompilerConfigurationBlock(IStatusChangeListener context, IJavaProject project) {
		super(context, project, getKeys());
		
		fComplianceControls= new ArrayList();
			
		fComplianceStatus= new StatusInfo();
		fMaxNumberProblemsStatus= new StatusInfo();
		fResourceFilterStatus= new StatusInfo();
		
		 
		if (ENABLED.equals(fWorkingValues.get(PREF_PB_SIGNAL_PARAMETER_IN_ABSTRACT))) {
			fWorkingValues.put(PREF_PB_SIGNAL_PARAMETER_IN_OVERRIDING, ENABLED);
		}
		fRememberedUserCompliance= new String[] {
			(String) fWorkingValues.get(PREF_PB_ASSERT_AS_IDENTIFIER),
			(String) fWorkingValues.get(PREF_SOURCE_COMPATIBILITY),
			(String) fWorkingValues.get(PREF_CODEGEN_TARGET_PLATFORM),