DEV Community

Discussion on: Let's revisit Java in 2019

Collapse
 
thorstenhirsch profile image
Thorsten Hirsch

Java is hip again, indeed. The language has received great updates as well as the JVM (and there are several to chose from). However project jigsaws can be a pain in the ass du to errors like this:

cannot access class jdk.internal.misc.Unsafe

Or this one:

...because module java.base does not export jdk.internal.misc to unnamed module.

And then you have to find out which VM args to use. Is it "–illegal-access=permit"? Or "--add-exports java.base/jdk.internal.misc=ALL-UNNAMED". Or even "--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED"? That sucks.

But on the plus side there's jlink. With jlink it's possible to build Docker containers of less than 100MB that includes Alpine Linux, a stripped down JDK 11 and your app with all dependencies. That's really a big achievement and compensates for the trouble that the Java module system has caused.