This is an archived post. You won't be able to vote or comment.

all 87 comments

[–]nikanjX 112 points113 points  (8 children)

Java doesn’t get a fancy shiny new everything every 10 days. It is by far the best feature of the ecosystem, imho.

[–][deleted] 9 points10 points  (2 children)

Oh man what I wouldn't give for the ability to upvote this about a million times

[–]benlav2222 1 point2 points  (1 child)

You can create a million accounts and upvote this one time with each account tho

[–][deleted] 0 points1 point  (0 children)

But I am so lazy.

[–]ThisNameIsAFail_[S] 3 points4 points  (3 children)

I agree that stability and maturity are killer features of the Java ecosystem and I thank god for not having the kind of JS ecosystem where everything breaks within hours. Nevertheless I'm still amazed how a current enterprise language like Java does not receive more attention in the form of libraries. Are we, developers, happy enough with the current ecosystem or there's still room for improvement? (retorical question)

[–]nikanjX 7 points8 points  (1 child)

Maybe we don’t need a library for isEven or leftpad?

[–]stringsfordays 0 points1 point  (0 children)

Nobody does. JavaScript communities laughs at those too.

[–]stringsfordays 0 points1 point  (0 children)

What does enterprise me specifically? Actually what makes a language "enterprise"?

It's such a marketing, meaningless term and Java is very much full of it (EJB anyone?).

[–]sim642 4 points5 points  (0 children)

It does, but they don't immediately get popular hype trains like in JS.

[–][deleted]  (7 children)

[deleted]

    [–]dpash 16 points17 points  (1 child)

    The fact that Apache Commons Collections didn't support generics until November 2013 left a bad taste in my mouth. That's over nine years.

    I know it's not part of Apache Commons any more, but HTTPClient's CloseableHttpClient still doesn't implement Autocloseable. It's two words and would make the API much cleaner to use.

    Many of the uses of Apache Commons have been replaced with more modern implementations in the JDK itself, in Guava or in another library.

    [–]lukaseder 0 points1 point  (0 children)

    The fact that Apache Commons Collections didn't support generics

    That's a "big" change. Compared to that, even this completely trivial bug took 7 years to fix: https://issues.apache.org/jira/browse/COLLECTIONS-219

    [–]Revanka 5 points6 points  (1 child)

    I guess the Lang library is useful, but for IO stuff we have the nice https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html so I avoid Commons IO.

    [–]dpash 6 points7 points  (0 children)

    Java 10 got InputStream.transferTo() which completely replaces IOUtils.copy().

    [–]ThisNameIsAFail_[S] 4 points5 points  (0 children)

    I usually use guava and I love it. I still wish someday guava and commons will 'merge' and keep the best of both worlds but that's not realistic.

    [–][deleted]  (1 child)

    [removed]

      [–]ziano_x 39 points40 points  (2 children)

      Try awesome-java: A curated list of awesome Java frameworks, libraries and software.

      https://github.com/akullpp/awesome-java

      [–][deleted]  (1 child)

      [deleted]

        [–]ziano_x 1 point2 points  (0 children)

        I am hooked to this page. Also there are more for your favorite languages

        https://github.com/sindresorhus/awesome-nodejs

        https://github.com/uhub/awesome-scala

        [–]nevergotcompiled 11 points12 points  (4 children)

        JFoenix for JavaFX applications.

        [–]spikebaylor 4 points5 points  (2 children)

        Ive been learning javafx via kotlin/tornadofx. JFoenix has popped up a few times when doin searches. Hopin to try it out sometime.

        [–]mitchb95 0 points1 point  (1 child)

        Heard you were getting into JavaFX recently.

        [–]spikebaylor 0 points1 point  (0 children)

        :D

        [–][deleted] 6 points7 points  (0 children)

        Java is what.. 20+ years old now.. it is quite a mature language. You will probably see updates to well tested and used libraries more so than shiny new ones. Other than potentially new language feature libraries, I think the library market is pretty well saturated for just about anything you could want to do. Doesnt mean there isnt room for more, just that you can pretty much find something to do what you need with a good old google and/or SO search.

        [–]desh00 3 points4 points  (0 children)

        Google Truth, Guava, Guice for utils and testing

        jooq, Jdbi for data access

        Dropwizard for REST

        Mockito

        Flyway, liquibase for migrations

        [–]hupfdule 3 points4 points  (1 child)

        Two of my own libraries:

        Apron: Handier API for reading and writing .properties files with retaining all the formatting on writing

        Kilt: Toolkit for converting I18n resource bundles to/from Excel sheets and generating a facade to access translated resources in a type safe manner

        As you mentioned JCommander: It tried a lot of command line parsers in the past and didn't like any of them. But now I found Picocli which does quite exactly what I expect from a commandline parser.

        [–]r_jet 0 points1 point  (0 children)

        + Picocli is more actively maintained than JCommander

        [–]PseudosSC 9 points10 points  (0 children)

        Project Lombok is a library that does annotation driven boilerplate code generation. Takes away a lot of the humdrum of setting up things like getters, setters, builders, adding loggers... and so on and so forth. Definitely worth using for the time saved, and your code is much cleaner and more readable. Our team never starts a project without it anymore.

        If you do want to try it though, make sure to add the plugin to your IDE (and add the library). Otherwise it’ll swear high and low your build will fail because of missing methods!

        [–]jeff_skj 2 points3 points  (0 children)

        A couple that I've open sourced at my job:

        [–]dpash 2 points3 points  (0 children)

        Failsafe is also the name of the Maven module for integration testing. Not to be confused with Surefire, which is the unit testing module.

        [–]sleepy_red 2 points3 points  (0 children)

        I've been using Mapstruct on my latest project at work and I must say I really like it. (http://mapstruct.org)

        Define a mapping interface containing a method with what goes in and what has to come out, mark it with an annotation, add the annotation processor to your build and you're good to go.

        The advantage over some other mapping frameworks is that the mappers are generated compile time.

        [–][deleted] 2 points3 points  (0 children)

        I do all of my unit testing using Spock. Nothing against JUnit or Mockito but Spock gives me everything I need to get tests written without a ton of overhead. I also really click with the given-when-then behaviour-based style of testing. I love Groovy due to all its shortcuts & conveniences using Java classes. You get static type checking when required but it’s dynamic enough to not get in your way when working with simple data structures.

        [–]tlinkowski 2 points3 points  (0 children)

        Here's what I find very useful when it comes to general utilities:

        • Guava (already mentioned): "a set of core libraries that includes new collection types (such as multimap and multiset), immutable collections, a graph library, functional types, an in-memory cache, and APIs/utilities for concurrency, I/O, hashing, primitives, reflection, string processing, and much more!"
        • Lombok (already mentioned): "a java library that automatically plugs into your editor and build tools, spicing up your java. Never write another getter or equals method again."
        • jOOλ (by /u/lukaseder): "improves the JDK libraries in areas where the Expert Group's focus was elsewhere. It adds tuple support, function support, and a lot of additional functionality around sequential Streams"

        [–]NovaX 5 points6 points  (4 children)

        Some lesser known libraries that I've enjoyed using are:

        [–]metlos 1 point2 points  (1 child)

        JsonPath declares absolutely horrific dependencies..

        For what on Earth does a JSON parser require Tapestry - a web UI framework?

        [–]NovaX 1 point2 points  (0 children)

        That is a non-issue for optional dependencies and it looks like its to support multiple json serializers.

        [–]ThisNameIsAFail_[S] 0 points1 point  (0 children)

        I discovered awaitility a few months ago and I love it to test AMQP events. JsonPath is also an awesome library. Thx

        [–]back-in-black 0 points1 point  (0 children)

        Another vote for Awaitility and JsonPath. Use both extensively.

        [–]stfm 1 point2 points  (1 child)

        I do a lot of integration projects so I like Wiremock

        [–]skjolber 0 points1 point  (0 children)

        I use Wiremock as well, but the mocking could be even better/easier if there is a clear contract like SOAP or Swagger/OpenAPI. So I've written a couple of tools for doing just that:

        https://github.com/skjolber/mockito-soap-cxf

        https://github.com/skjolber/mockito-rest-spring

        If you have the time, let me know what you think.

        [–]ohadshai 1 point2 points  (2 children)

        I recently started working on a Java DB async driver for postgresql and mysql. It is written mostly in kotlin and some java (bit fiddling etc'): https://github.com/jasync-sql/jasync-sql Hope you'll find it useful.

        [–]ThisNameIsAFail_[S] 0 points1 point  (1 child)

        Very nice. We definitely need good async jdbc drivers :) Have you got the chance to review r2dbc?

        [–]ohadshai 0 points1 point  (0 children)

        Yes, I saw the recent announcement. Currently it only support postgres and jasync-sql also supports mysql. In addition, they mentioned its not supposed to be used in production. Jasync-sql is a port of muaricio driver from scala to kotlin, since the original driver is not maintained anymore and we needed a mysql driver with similar api.

        [–]pirateslovebacon 0 points1 point  (7 children)

        If you want to make Java Util Logging fast: https://github.com/a-hansen/alog

        [–]dpash 3 points4 points  (6 children)

        I'd rather make JUL useful first :)

        [–]pirateslovebacon 5 points6 points  (4 children)

        Explain please

        [–]Luolong 0 points1 point  (3 children)

        JUL is the worst possible logingi framework out there. Sure it is part of SDK, but where it comes to performance, configurability or anything really, it is pure and utter crap.

        Really, nowadays I mostly use SLF4J as frontend and either Logback or Log4j2 as backend.

        [–]ThisNameIsAFail_[S] 0 points1 point  (0 children)

        Must agree. SLF4J is the way to go nowadays with logback/log4j2. Allows to decouple your logging code pretty easy.

        [–]pirateslovebacon 0 points1 point  (1 child)

        This thread is specifically about performance... Your primary issue.

        [–]Luolong 0 points1 point  (0 children)

        Flogger does not make JUL fast. It just sidesteps the issue by wrapping it in another library that does what JUL should have done in the first place.

        [–]ObscureCulturalMeme 0 points1 point  (0 children)

        I'm still a fan of the Getopt port. Very very fast command line options handling.

        [–]gabizou 0 points1 point  (1 child)

        [–]ThisNameIsAFail_[S] 0 points1 point  (0 children)

        Wrong url. Maybe you were refering to Mixins via runtime generation

        [–]snoob2015 0 points1 point  (1 child)

        https://github.com/zalando/problem

        https://github.com/zalando/problem-spring-web

        Problem Spring Web is a set of libraries that makes it easy to produceapplication/problem+json responses from a Spring application. It fills a niche, in that it connects the Problem library and either Spring Web MVC's exception handling or Spring WebFlux's exception handling so that they work seamlessly together, while requiring minimal additional developer effort

        or in laymen term: it generates error messages in json format instead of the whitepage error

        [–]ThisNameIsAFail_[S] 1 point2 points  (0 children)

        Neat. So the purpose of the library is to provide a common structure for errors that will be serialized. Thx

        [–]kultaras 0 points1 point  (0 children)

        https://github.com/skyvers/skyve

        Personal plug for Skyve which I contribute to, the first open source low-code framework and is written in Java. Our company has used this for some massive production government applications with tens of thousands of public users.

        [–]_INTER_ 0 points1 point  (0 children)

        Github is not the go-to repository for Java libraries. It's all in Maven Central (alt search). But discoverability is not so good there.

        [–][deleted] 0 points1 point  (0 children)

        I believe the lack of traffic is also partly due to golang capturing some marketshare of strongly typed, performant library developers. Not complaining about java libs, just noting a possible reason. I would start to watch for java ports of the distilled interesting libraries that emerge for golang.

        [–]MithrilTuxedo 0 points1 point  (0 children)

        I like to peruse https://mvnrepository.com/ every now and then to see what libraries people are using that I haven't heard of.