NOTE: This appears to be a limit in the \"javac\" program.
I have Java 6 code that needs to be built for a Java 5 JVM. My previous work with the javac ant target (
The real question is thus to use @Override
in source files that need to be compiled in Java 1.5 class files.
javac -source 1.5 -target 1.5 aFileWithOverride.java
will do just that. In jdk 7, this will lead to a warning
[options] bootstrap class path not set in conjunction with -source 1.5
which is absent in jdk 6.
To get rid of this warning a special boot class jar can be created by adding the java 6 (or higher) java.lang.annotation
package to a java 5 rt.jar
.