Adding CLASSPATH in NetBeans

て烟熏妆下的殇ゞ 提交于 2021-02-05 10:46:07

问题


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

  1. have the connector in your computer downloaded, for my case I downloaded from https://dev.mysql.com/downloads/connector/j/

  2. Right click on your project in the projects window as shown here image for right click

  3. On the dialog window click on Libraries, then click Add jar/folder. Make sure the check box (Build projects on class path) is checked.

  4. Select your connector/ jar file you want in your case. Then Click open.
  5. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!