问题
I need to add classpath in NetBeans
. I'm reading book "Thinking in Java 4th Edition".
From doc:
"In the Projects window, right-click the project node and choose Properties. Click Libraries in the left panel of the Project Properties dialog box. Adding library path in the right panel."
I did that, but when I wrote : import static net.mindview.util.print.* I see next:package net does not exist
Help. Why package does not exist?
回答1:
I recently added a classpath for Java mysql-connector in Netbeans. This may help someone who has been struggling to do it like me
have the connector in your computer downloaded, for my case I downloaded from https://dev.mysql.com/downloads/connector/j/
Right click on your project in the projects window as shown here image for right click
On the dialog window click on Libraries, then click Add jar/folder. Make sure the check box (Build projects on class path) is checked.
- Select your connector/ jar file you want in your case. Then Click open.
- It will be appended in the dialog box as shown below. image for dialog box
click OK
来源:https://stackoverflow.com/questions/11708330/adding-classpath-in-netbeans