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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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:
You then create the jarfile, specifying the manifest file above. If doing this manually, it’s something like:
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.
which runs Java, putting your jarfile on the classpath (i.e. making all your classes available) and specifies that
MyClassis the main class, i.e. the starting point for your application.MyClassmust have amainmethod defined, or this won’t work.