Can someone tell me where and how I set the classpath in NetBeans? I would like to add a .jar file.
To add a library reference to the project classpath, follow this procedure: Right-click on the project in the Project Explorer view and select Properties from the drop-down menu. This will open the Propertis dialog. On the Propertis dialog, select the Java Build Path from the list of properties.
Right-click the user name package and select New -> Java Main Class... Name your class Menu . Run the project. You will be prompted to select the main class.
You have 3 solutions: add this class in the path of your other compiled classes (respecting the package naming of your directories) add the root directory of this class in your classpath (in your case "C:\java\project\") add this single class into a jar and add this jar to the classpath.
Properties
.Libraries
.Compile tab
- click Add Jar/Folder
button.Or
Libraries
.Add Jar/Folder
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With