Is there a package manager for Java like easy_install for Python ?
I'm looking for a solution usable from the command line and not from an IDE.

- 2,151
- 2
- 19
- 30

- 71,966
- 47
- 171
- 241
-
4What do mean with "package manager"? java libs are not installed into OS, just bundled with you app classpath. – Igor Artamonov Apr 25 '10 at 22:45
-
12As a python guy taking java on for the first time under professional dictates - I wish. Something like NPM would be great. – DeaconDesperado Apr 11 '13 at 21:07
-
Like Nuget for visual studio – Seyed Morteza Mousavi Jul 28 '14 at 17:40
-
2I don't see this mentioned but if you use ubuntu most of the most common packages are available like `apt install maven` or `apt install gradle` – Lime Feb 11 '17 at 16:39
-
6This is not off topic to close, it is a valid question for python developers who try to write JVM languages. – Jemshit Apr 12 '19 at 12:13
3 Answers
Maven does provide dependency management based on remote repositories (like the central repo) that are browsable, searchable.
Maven Ant Tasks (retired) use Maven's repositories to provide dependency management and more to Ant builds.
Ant Ivy is another alternative to Maven Ant Tasks.
MOP is another command line tool that leverages Maven's repository and dependencies.

- 6,741
- 7
- 52
- 69

- 562,542
- 136
- 1,062
- 1,124
-
-
@systempuntoout Tried, yes. Used regularly, no. I actually work mostly with server sides apps and I do almost everything with Maven. – Pascal Thivent Apr 26 '10 at 21:54
-
Edit 2017-04-27: I have been disappointed by the lack of forward momentum for jpm4j, and the lack of community-centric development. So I invented a new tool called jrun. I invite everyone to check it out. It has a narrower scope than tools like Python's pip
, but it does let you execute Java code from remote Maven repositories in an easy-to-use manner.
Check out JPM4J. It is a project by Peter Kriens (of BND fame). He first proposed it last year, and as of this writing it has been around for a few months and is looking pretty impressive.
It was inspired by Node's npm, and like that tool, installation is a cinch:
OS X:
local $ curl http://www.jpm4j.org/install/local | sh
global $ curl http://www.jpm4j.org/install/global | sudo sh
Linux:
curl http://www.jpm4j.org/install/script | sh
And Windows has a clicky installer, of course.
Then you install stuff similarly to other command-line package manager tools. E.g.:
jpm install org.codehaus.groovy:groovy-all
The install command operates Maven coordinates. Basically, the JAR just needs a JPM-Command
entry in its manifest, and jpm
knows how to expose its main class as a command-line executable.
Personally I would really love to see the Java community get behind an effort like this. A really solid Java package manager is years overdue!
-
-
6
-
1I have edited my post with information about a new project I have started called `jrun`. – ctrueden Apr 27 '17 at 13:31
-
-
@DerekMahar You can optionally specify a main class as part of a `jrun` endpoint. If you leave off the main class, it will use the `Main-Class` defined in the artifact's JAR manifest. – ctrueden Nov 09 '18 at 01:12