Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set the classpath in NetBeans?

Can someone tell me where and how I set the classpath in NetBeans? I would like to add a .jar file.

like image 263
Borut Flis Avatar asked Sep 29 '11 14:09

Borut Flis


People also ask

How do you add classpath to a project?

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.

How do I select main class in NetBeans?

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.

How do I fix a classpath problem?

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.


1 Answers

  1. Right-click your Project.
  2. Select Properties.
  3. On the left-hand side click Libraries.
  4. Under Compile tab - click Add Jar/Folder button.

Or

  1. Expand your Project.
  2. Right-click Libraries.
  3. Select Add Jar/Folder.
like image 131
Bhesh Gurung Avatar answered Oct 06 '22 08:10

Bhesh Gurung