12

I am new to java, and I am trying to build a project that has 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 can install the missing external package? Is there a java package manager similar to the python pip?

4 Answers 4

3

You could use maven which would do the dependency handling and building for you.

Dependency management is a core feature of Maven. Managing dependencies for a single project is easy. Managing dependencies for multi-module projects and applications that consist of hundreds of modules is possible. Maven helps a great deal in defining, creating, and maintaining reproducible builds with well-defined classpaths and library versions.

Sign up to request clarification or add additional context in comments.

Comments

1

There's not a package manager that I know of. You're going to have to manually download the jar file -- in this case, its from http://www.slf4j.org/ . After that, you can either do as Dennis says, or add the jar file explicitly to your classpath.

Comments

0

You can use this site to find the .jar file: https://www.findjar.com/

Then place the file into your JRE/JDK's ext folder, e.g.: C:\Java\jdk1.8.0_201\jre\lib\ext\

Comments

-2

To import a package: -> Download the required jar files (One of the sources for jar files is:https://jar-download.com/) -> Paste the file @ C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.