How to install jar library?

I downloaded the Java ANTLR runtime libraries. This is a jar file. It contains "org.antlr.runtime". Where can I say that the Java compiler can find it? Do I need to remove it? I use NetBeans (for now) if necessary.

+9
java classpath netbeans
source share
3 answers

For NetBeans, you will go to the Projects tab, then right-click the project that you want to add to the library, then click Properties. Go to the "Libraries" panel, then on the right side click "Add JAR / Folder". No need to retrieve it. All you have to do is right-click in the editor window and click "Fix Import".

For use outside NetBeans, you must add it to your Java path.

+3
source share

Assuming you can find your jdk folder, you can move the .jar file to the jdk \ jre \ lib \ ext folder, where other .jar files are located. After that, NetBeans should be able to run files with access to the library.

+7
source share

For the java command line, you need to add it to your class path, but in Netbeans you just need to add it as a library. It could be anywhere. Google to find out how to do this.

In fact, in netbeans, you can simply say that you need this in your maven project, and it will load the jar and its source / documentation as needed.

+3
source share

Source: https://habr.com/ru/post/649964/


All Articles