. Advertisement .
..3..
. Advertisement .
..4..
I get an error
warning: [options] bootstrap class path not set in conjunction with -source 1.5
when trying to use bootstrap for my job. How to fix the bootstrap class path not set in conjunction with 1.5 error? Please give me some advice.
The cause:
You get this error because you did not set the bootclasspath based on rt.jar for the compilation purpose, so Javac will strictly use the new libraries along with the old language rules, which lead to class files that are incompatible with earlier platforms because they contain references to non-existent methods. Therefore, it raises an error.
Solution:
The correct procedure to cross-compile javac from the JDK N to an earlier platform version is:
1, Using the default configuration for -source.
2, Set the rt.jar (or corresponding) for the earlier platform’s bootclasspath to compile against.
If you do as the above suggestions, your problem will be solved.
Bootclasspath usage
Locate
rt.jar
on UNIX systems using:JAVA_HOME
should be set sort.jar
is located in$JAVA_HOME/jre/lib/rt.jar
Tested with Ubuntu 14.04 and Oracle Java 7.