Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

People say this but where do you find libs for Java?

Python has pip,

JS/Node has NPM



To compliment most other posters, they would use Maven Central: https://search.maven.org/

Here is an example library from Google called "Guava": https://search.maven.org/artifact/com.google.guava/guava/31....

You can find the source code on GitHub: https://github.com/google/guava

On the right side of the page, you can find eleven (!) different wants to include this dependency (and) all of its transitive dependencies with just a few lines of configuration.

Here is a list of the Top 10 downloads of open source Java libraries: https://mvnrepository.com/popular?p=1


>People say this but where do you find libs for Java?

Everywhere, on the lib website, on GitHub, on Apache, etc. (including centralized places like Maven Central). You then put a ferences in your Maven or Gradle file like you would in your package.json.

In fact, because for 99% of the libraries you just need to have a jar (or more) in your classpath, you don't have to have all the ceremony that Python has, and all the installation mess, venvs, and other such shite.


Until you end up with dependencies transitively pulling in conflicting versions of Jackson or similar and you need to mess around with dependencyManagement or exclusions.


Transitive dependency trees are a feature, not a bug


> JS/Node has NPM

If this isn't a joke, I'd suggest learning the Maven or Gradle build systems. NPM has such horrible dependency management that these Java systems will seem like magic!


OK, so I'm trying out maven central as people in this thread are recommending. As an example, I'm searching for a command line argument parser.

The first thing I'm noticing is that there seems to be no way to judge the popularity of the libaries (an often-used proxy for quality, e.g. number of downloads, GitHub stars, etc).

I enter "argparse" and the first hit isn't even Java! It seems to be a npm package?? https://search.maven.org/artifact/org.webjars.npm/argparse

I enter "argument parser" and there are two hits. One with zero stars on Github and one with 1 star.

https://search.maven.org/artifact/com.github.easy-develop/ar...

https://search.maven.org/artifact/com.github.raphcal/argumen...

"command line" brings up another 0 star option: https://github.com/AlmondBranch/command-line-parser

I suppose the Java package ecosystem must be good if everyone says it is, but so far it looks to me like I'd find Maven Central very inefficient to discover high quality packages.


Maven Central is the place where the libraries are hosted, but not the place where they are found by users. Use Google/Stackoverflow/Reddit and simply search for what you want.

Searching for "command line argument parser java" immediately leads you to libraries and infact lists of libraries (see https://stackoverflow.com/a/7829772), of which most are going to be available on Maven Central.

Then you do your research that the library you are looking at looks valid and is trustable (!) by checking out the info available on it, maybe make another search to find opinions on it.

Then when you have decided to try it, look at its docs to find out where it s located on Maven Central and use it from there.


I think you're searching in the wrong place. The first search result for "argument parser maven" in google search yields this [1] - an ordered list of maven dependencies for "Command Line Parsers".

[1] https://mvnrepository.com/open-source/command-line-parsers


mvnrepository.com is good for what you are describing [1]. For example, searching for "command line" brings up the clear top favorite and tells you the number of usages:

https://mvnrepository.com/search?q=command+line

[1] https://mvnrepository.com/


IMO maven is much better than gradle these days. Indeed maven or go dependency management is refreshing after you run create-react-app or shit like that.


The Java ecosystem of libraries is huge, it used to be one of the largest ones. I don't know how it competes today with Python and JS, but Java certainly doesn't lack libraries for almost anything you can think of.

Also: Maven Central.


Err ... the npm authors (the CommonJS modules/packages spec writers for package.json) mention maven and CPAN in their design docs and discussions as reference. Many of the early Server-side JavaScript adopters (in the 2000's before Node.js but well after Netscape's server-side JavaScript) were, in fact, Java/J2EE dropouts longing for something simpler.

[1]: http://wiki.commonjs.org/wiki/Packages/1.0


One of the nice things about Java and C# is that they tend to have "chunkier" dependencies, that aren't split out into an interlocking tree of dependencies deep and wide.

For the most part, anyway... Things are kind of gross if you are trying to use newer nuget packages on the old 4.8 .net framework...


In Java-land most people build and do dependency management with Maven or Gradle. In either case, these tools can pull from repositories based on the Maven format. The vast majority of popular libraries are in repo "Maven Central" and "just work" if added to your dependency list. A number of smaller, more specialized repos also exist, and it's trivial to add additional repos to your Maven/Gradle config as well.

You can search for libraries on mvnrepository.com, or your IDE can search the index. Also most libraries will include a section in the documentation that shows the details of the blob you have to put in your pom.xml / build.gradle file.


Maven central




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: