How to create a library in NetBeans
I have a class Utilities.java
that I would like to include in a library that I can include in future projects.
I made a new project, Java class library and named the class Utilities
and put it in a folder C:\Users\Dov\Google Drive\NetBeansProjects\Utilities
.
In a new project, I tried to add a library via Libraries, Add jar / folder and gave a name C:\Users\Dov\Google Drive\NetBeansProjects\Utilities\dist\Utilities.jar
, so in libraries I had JDK 1.8
and Utilities.jar
.
But I got errors ( cannot find symbol
) on all attempts to use methods in Utilities.jar
.
What should I have done?
source to share
OK. I deleted Utilities.jar
from the folder Libraries
, then right clicked Libraries
and this time selected Add library...
, which opened the dialog that I clicked in Create library
.
I gave the name of the new library Utilties
and pressed Add jar/folder
, then gave way to a file jar
: C:\Users\Dov\Google Drive\NetBeansProjects\Utilities\dist\Utilities.jar
. Now I have a library named in my Libraries folder Utilities - Utilities.jar
and everything is fine.
source to share