0

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?

Will Ness
  • 70,110
  • 9
  • 98
  • 181
Sergey
  • 37
  • 1
  • 2
  • 5
  • What exactly did you add to the project libraries? –  Jul 29 '12 at 10:09
  • This is a possible duplicate of [How to use .jar files in NetBeans?](http://stackoverflow.com/questions/1975973/how-to-use-jar-files-in-netbeans), which has some helpful illustrations. – trashgod Jul 29 '12 at 10:27
  • And when i add this folder i see that in my project - library. I see folder and if i press "+" . I will see many yellow boxes. Example: " net.mindview.util" , "net", ... – Sergey Jul 29 '12 at 16:30

1 Answers1

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

kimoduor
  • 504
  • 6
  • 16