r/javahelp • Lead Software Engineer / EU / 20+ YXP • Mar 17 '21

[PSA] Java 16 has just been released which comes with a packaging tool and records!

Hi! I wanted to point this out because this comes up a LOT in this sub; 'how do I turn my Java program into an executable'. And then we also see a lot of responses from people who try to help, but are not aware of recent additions.

You can find what is in Java 16 here.

The two most important additions I think for people in this sub are records and the packaging tool

Records are mostly just immutable classes that take away most of the fuss of having to write getters, setters, hashcode, equals and toString. More info here.

Jpackage is a tool that lets you take your program and bundle it with a trimmed down JDK into a native executable / installer. So for Windows it supports msi and exe, for MacOS pkg and dmg. This makes it a lot easier to share whatever you created with others, be it a GUI or a service. More info here.

92 Upvotes

Duplicates