I have an eclipse project where the source output must comply with version 1.3 of the Java language specification
- /src/ (must run on a Java 1.3 JRE)
- /test/ (must run on a Java 1.6 JRE)
The application will run on a java 1.3 JRE (phoneME J2ME Advanced profile, if anyone is curious), while the test code uses JUnit 4, Mockito, etc… and so requires running on a JRE supporting java 1.5 or higher.
I can only seem to configure java language levels on a per-project basis, nothing more granular. At this stage I have set the project language level to 1.6, and use a Makefile to build the final jar with java 1.3 as the target.
Is there a way to have my cake and eat it? Is there a way to set up multiple language levels (and system libraries) within a single project? The only other option I can think of is to split the test code into its own project, which feels like a kludge.
I don’t think this is possible within a single project. But it should be easy to separate the test part out into a second project, that depends on the original.