r/java • • Mar 19 '19

Java 12 Released !!!

https://www.oracle.com/technetwork/java/javase/downloads/jdk12-downloads-5295953.html
235 Upvotes

98 comments sorted by

View all comments

78

u/MasterLJ Mar 19 '19

...and here I am still Java 8ing =|

29

u/Life_is_a_meme Mar 19 '19

I don't even know how to migrate to Java 9 and they're already on Java 12...

77

u/MasterLJ Mar 19 '19

Step 1 : Download the Java 9 JRE

Step 2 : Try to run your existing app

Step 3 : Tears

Step 4 : Use the Java 8 JRE

29

u/_INTER_ Mar 19 '19 edited Mar 20 '19
  • Java 9 is EOL

  • There's no JRE for Java 11+ (you're supposed to build a runtime that fits your application using jdeps / jlink)

11

u/thedomham Mar 20 '19

There's no JRE for Java 11+

For everyone who was as confused upon reading this statement as me: it's true. There is no JRE anymore. The JRE is practically a subset of the JDK and with jigsaw you are supposed to use the new Java linker (jlink) to bundle an application-specific runtime with your jar instead of relying on a complete runtime (JRE) being available in your target environment.

I initially thought "there is no JRE" was some part of the Oracle license change fearmongering '

2

u/_INTER_ Mar 20 '19

Thanks, I've clarified that point

19

u/MasterLJ Mar 19 '19

This guy expects a Java 8 Rockstar Ninja to know these things. Sheesh!

3

u/duheee Mar 19 '19

Step 5: ????

Step 6: Profit!!!!!

1

u/[deleted] Mar 19 '19

Step 7: VC funding

Step 8: MOAR PROFIT

0

u/duheee Mar 19 '19

Step 9: me in Bahamas with margaritas on the beach.

8

u/MMPride Mar 20 '19

I've migrated all my apps to Java 11, or at least, my ones that will be migrated to Java 11. It's quite... interesting, to say the least. It ranges from easy to very hard depending on what your app uses in terms of dependencies, etc.

5

u/KamiKagutsuchi Mar 19 '19 edited Mar 19 '19

For java 9 most likely all you have to do is add --add-module java.xml.bind when running the program if you use xml (or most json) parsing libraries. Otherwise you dont have to do anything.

For java 10+ you have to get replacement libraries for the crap (including xml binding) that has been removed from the jdk. Most likely you don't need any of these libraries, except maybe xml binding.

5

u/MMPride Mar 20 '19

Well, you have to add a lot of modules if you're using JavaFX, like, 250 characters worth of modules... other than that, upgrading to Java 11 is mostly okay depending on what dependencies your app uses.

I gotta admit, the add-module shit isn't quite as nice as just java -jar app.jar.

4

u/KamiKagutsuchi Mar 20 '19

Or just include a dependency on openjfx 11?

2

u/MMPride Mar 20 '19

If the jar is built with Java 9+ support in mind, yeah. If the jar is no longer maintained and you are stuck with a version that doesn't have module support built in? Well, then you may need hundreds of characters instead of just java -jar app.jar.

2

u/endeavourl Mar 20 '19

Isn't is supposed to add them automatically when the jar is also a module that declares it's module dependencies?

1

u/MMPride Mar 20 '19

If the jar is built with Java 9+ support in mind, yeah. If the jar is no longer maintained and you are stuck with a version that doesn't have module support built in? Well, then you may need hundreds of characters for adding modules instead of just java -jar app.jar.

1

u/dpash Mar 19 '19

You can also add the maven/gradle dependency for java.xml.bind API. In some cases you might also need an implementation of the API, but that's just a dependency away too.

4

u/BoyRobot777 Mar 19 '19

I would advice to get "Java 9 Modularity" book. For me, it made a lot of things clear. They also have migration chapter, where they migrate Spring/Hibernate application. Also, a chapter on Maven.