I want to build my code with Java 6, but use compile time checks of Java 5.
For example, I want the compiler to complain about @Override
annotation for interfaces (introduced in Java 6).
Do you know how to do this?
I want to build my code with Java 6, but use compile time checks of Java 5.
For example, I want the compiler to complain about @Override
annotation for interfaces (introduced in Java 6).
Do you know how to do this?
go with right mouse button on your project->properties->java compiler
ther you can enable "Enable project specific settings" and choose an own compiler java version
The JRE preference seems to be at the workspace not project level. To change the JRE, Window...Preferences. Open up the tree under 'Java'. Choose "Installed JREs". If there's only one there, you can't remove it. Click 'Add...'. Browse to the base directory of the Java installation, e.g. /usr/java/jdk1.6.0. Give the JRE a name and click OK. This adds the new JRE to the list of JREs available. To select it as the default JRE, it must be checked in the Installed JREs window.
If you are using Maven (or Ant) for building your project, then you can specify Java 6 in Maven and keep eclipse using Java 5.