| [news.eclipse.newcomer] Re: Compiling for older version of java |
I have set the Compiler Compliance level to 5.0 and verified the project now shows that the JRE System Library [JSE1-1.5] is loaded. However, when I attempt to run the jar file on an OSX box with JRE 1.5.0_07 I receive the following error:Are you sure that your project settings are set to 1.5 for the compliance, source and target?
'Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file'
All my research reveals the obvious, the error indicates that I am attempting to run class files which were compiled on a a newer version of java on a system with an older version of java. This is the case as I have just explained, but I thought that setting the Compiler Compliance would cause the class files to be written to that version (as well as ensure I only use functionality in that version)?If you take the default settings corresponding to compliance 1.5, then the source and target settings should indeed be set to 1.5.