Hacker News new | ask | show | jobs
by csdreamer7 2107 days ago
Is there anything like this in Java?

I am aware of launch4j, but curious if there is a single step approach for all 3 platforms.

1 comments

Yes, since Java 9: it is called "jlink" and it's shipped with the OpenJDK. It assumes you have modularized jars.

An alternative is the GraalVM, which can compile the code as a C++ binary or a shared application, using LLVM as backend. If you work with Webservices (especially JavaEE), you might also want to have a look at Quarkus, which also uses GraalVM to create single binary executables

jlink/jpackage just isn't the same as the other things. It doesn't produce a single executable like .Net core or Bakeware which embed the vm into the binary. In .Net's case it self extracts on first run.

With jlink/jpackage you either ship an installer or a zip file.