Installing an external java package

I am new to java and I am trying to create a project with an external dependency. When I try to build it

[javac] Compiling 814 source files to ~/Desktop/Dev/bitcoinj/out
[javac] ~/Desktop/Dev/bitcoinj/src/com/google/bitcoin/core/Block.java:25: package org.slf4j does not exist
[javac] import org.slf4j.Logger;
[javac] ...

How to install a missing external package? Is there any java package manager similar to python pip?

+9
source share
5 answers

There is no package manager that I know of. You will have to manually download the jar file - in this case, it is from http://www.slf4j.org/ . After that, you can either do as Dennis says, or add the jar file explicitly to your classpath.

+1
source

maven, .

Maven. . , . Maven , .

+1

, Apache Maven, java.

0

jar JRE lib/ext, .

Windows,

C:\Program Files\Java\jre1.6.0\lib\ext\

C:\Program Files\Java\jdk1.6.0\jre\lib\ext\

, javac JRE , , jar.

- CLASSPATH, , .

-1

: -> JAR ( JAR:https://jar-download.com/) -> @C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext

-2

All Articles