donanimsal
donanimsal

Reputation: 15

how to use .jar files in netbeans8

It is the first time for me to work on a project with external library.

I have downloaded svnkit-1.8.10 which consist of three files:

-svnkit-1.8.10-sources

-svnkit-cli-1.8.10-sources

-svnkit-javahl16-1.8.10-sources

First one is enough to complete my job. I tried to add it by right clicking on Libraryes -> then add JAR/Folder

enter image description here

It successfully added the library. However in the code I could not make it work. It gave me package does not exist.

enter image description here

Upvotes: 1

Views: 50

Answers (2)

Shrinivas Shukla
Shrinivas Shukla

Reputation: 4453

I answered the question in the comments section. Just posting it as an answer so that it will be helpful for others who visit this page.

The jar file which is currently added in the libraries is svnkit-sources which contains .java files only.

To use external libraries in your project, you need to add the jar file containing .class files which is available here.

Upvotes: 0

Puce
Puce

Reputation: 38132

Look for JAR files which contain .class files instead of .java (source) files.

Once you have the basics, I recommend to use a tool which supports Maven Dependencies, eg. Maven itself: http://books.sonatype.com/mvnref-book/reference/public-book.html

These tools can download and manage dependencies from private or public Maven Repositories such as Maven Central: http://search.maven.org/

You can also manually download artifacts from there, eg. the svnkit.

Upvotes: 1

Related Questions