[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 434
  • Last Modified:

Build Warning!

How can I get this warning off my Build procedure

warning: [options] bootstrap class path not set in conjunction with -source 1.5
Note: C:\Documents and Settings\User\My Documents\NetBeansProjects\iDA\iDA\src\ida\resources\NewPortalConnection.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
  • 4
3 Solutions
You probably need to use generics in the collections - arraylistor hashmap or something


To oversimplify it, if you have multiple versions of Java say 5, 6 and 7 installed you want to be sure that you compile and run with the same version. This warning suggests to me a possible incompatibility exists compiling for an old JVM and running on a new one.

The unchecked ones are a generics issue and the source level compatibility issues that arise. Older classes such as much of Swing did not use generics so you would have had a return class like JList whereas the newer compilers would want something like JList<String> so it can do type checking at compile time. As far as I can tell not all Swing components have been upgraded to use Generics although some have. So even compiling and running on Java 7 has situations where this warning comes up.



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.

Thanks to work by Jon Gibbons, in JDK 7 build 121 and later javac detects and warns about this suspicious situation; for example:

    $ javac -source 6 HelloWorld.java
    warning: [options] bootstrap class path not set in conjunction with -source 1.6

One way to address the warning is to set the bootclasspath. If that is inappropriate, the warning can be disabled with a new suboption within the -Xlint family, -Xlint:-options.

With this change, a likely problematic combination of options to javac that can lead to subtle build errors are diagnosed by the compiler and can easily by either directly addressed, or documented as part of the build process via the new -Xlint suboption.
recompile with -Xlint and you'll n=know what in particular is a problem; we can then try to address it _ most probable it is about generics
snajalmAuthor Commented:
Thanks heaps!

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now