0

This is when i tried to build my Java code using Netbeans, i have no idea to solve it:

warning: [options] bootstrap class path not set in conjunction with -source 1.7 Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 warning

Adam Mudianto
  • 71
  • 3
  • 13

1 Answers1

2

You're telling the Java 8 (or later) compiler to treat your sources as Java 7 code.

But you're not setting the bootclasspath, so the compiler can't check that your code, supposed to be compatible with Java 7, doesn't use classes and methods that exist in Java 8, but don't exist in Java 7. So your code has a big chance of not being compatible with Java 7, hence the warning.

If your goal is indeed to be compatible with Java 7, then

  • install and use a Java 7 JDK instead of the JDK you're using now (simplest option)
  • or set the bootclasspath as the message tells you.

If you don't want to be compatible with Java 7, then change your compiler settings to use the source level you actually want.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255