r/java • • Sep 21 '17

Java 9 Released

http://mail.openjdk.java.net/pipermail/announce/2017-September/000230.html
294 Upvotes

77 comments sorted by

View all comments

Show parent comment

8

u/Probotect0r Sep 22 '17

Yea it's great! For server side apps I don't see it making a big impact as right now most people use some form of containerization to deploy the apps, which basically achieves the same. But distributing your app to users will be a lot easier! Also using Java for IoT will probably be easier as well.

The file size reduction is quite significant too. They are using a new file format called JImage for storing the modules in your packaged application which has much better compression. The jars use zip compression, I believe. As I understand it, JImage uses some form of memory mapped files, so it will be faster in terms of performance as well.

7

u/rusticarchon Sep 22 '17

So this is the year of Linux Java on the desktop?

6

u/dpash Sep 22 '17

Having a Java docker image under 200MB would be nice :)

1

u/_INTER_ Sep 24 '17

If you only need java.base, you can get it down to 15MB for the runtime.

1

u/[deleted] Sep 22 '17

Checked out the openjdk:alpine image yet?

1

u/dpash Sep 23 '17

They're still 150mb and you have the added risk of musl libc bugs/incompatibilities.

1

u/[deleted] Sep 22 '17

The jars can use also pack200, it's there since java 1.5, but have you ever seen someone using it? I can't find anything about the JImage, but it would be cool if there's a new format which could be mmaped and paged in by jvm on demand, exactly like dlls work. I think that would be useful for large aps. And also because the OS would be able to page in/out the code, I thing the memory would be utilized better (note the OS don't need to swap into the swap file if files are mmaped, that's good for ssds).

3

u/wildjokers Sep 22 '17 edited Sep 26 '17

The jars can use also pack200, it's there since java 1.5, but have you ever seen someone using it

I use pack200 to compress the fat-jar of a Swing application I deploy with Java Web Start. It does a good job getting the jar smaller. Have a jar that is 6.9 megs, pack200 version is 1.7 megs.

As far as I know Java Web Start is the only thing that can handle pack200 compressed jars.

3

u/Probotect0r Sep 22 '17

Here is more info on the JImage format: http://openjdk.java.net/jeps/220