I created a jar file for my project , but the following warning appeared , and when double click on it , it does not open
warning: [options] bootstrap class path not set in conjunction with -source 1.6 1 warning
I'm using NetBeans 7.0.1 / Windows 7
I created a jar file for my project , but the following warning appeared , and when double click on it , it does not open
warning: [options] bootstrap class path not set in conjunction with -source 1.6 1 warning
I'm using NetBeans 7.0.1 / Windows 7
The warning is not necessarily the problem with making it clickable.
To make a JAR executable, you have to specify the 'main' class in the JAR's 'manifest' file, for example:
Manifest-Version: 1.0
Main-Class: MyMainClass
You then create the jarfile, specifying the manifest file above. If doing this manually, it's something like:
jar cvfm myapp.jar myManifest *.class
If you created the JAR from NetBeans instead, I expect there's a setting for this:
Updated see Producing executable jar in NetBeans for information on this.
If you don't specify the main class, then the JAR can be used as a library, but it can't be executed directly as a program without using a commandline script to specify which class to run, e.g.
java -cp myjar.jar com.myco.myproj.MyMainClass
which runs Java, putting your jarfile on the classpath (i.e. making all your classes available) and specifies that MyClass is the main class, i.e. the starting point for your application. MyClass must have a main method defined, or this won't work.
The warning suggests that there may be a difference between the version of Java that some of your libraries/dependencies are written in and the version you compiled your project with.
In my experience, this warning can usually be ignored. But that is certainly anecdotal.
In the future, the warning can be disabled with the flag -Xlint:-options in
"additional compiler options" in Netbeans.
A more official explanation can be found here.