java – warning:[options] bootstrap类路径未与-source 1.5一起设置

我在构建时收到警告消息!

warning: [options] bootstrap class path not set in conjunction with
-source 1.5

我该如何解决?

引自blogs.oracle.com/darcy/entry/bootclasspath_older_source

To use javac from JDK N to cross-compiler to an older platform version, the correct practice is to:

  • Use the older -source setting.
  • Set the bootclasspath to compile against the rt.jar (or equivalent) for the older platform.

If the second step is not taken, javac will dutifully use the old language rules combined with new libraries, which can result in class files that do not work on the older platform since references to non-existent methods can get included.

http://stackoverflow.com/questions/7816423/warning-options-bootstrap-class-path-not-set-in-conjunction-with-source-1-5

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:java – warning:[options] bootstrap类路径未与-source 1.5一起设置