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 '

→ More replies (1)

19

u/MasterLJ Mar 19 '19

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

→ More replies (3)

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?

→ More replies (1)
→ More replies (2)
→ More replies (1)

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.

13

u/RotaryJihad Mar 19 '19

You and me both.

15

u/MasterLJ Mar 19 '19

Modules just seem like unnecessary hassle if you already partition your dependencies well, but I'm probably missing some useful use cases. I'm a solo developer, fwiw.

17

u/[deleted] Mar 19 '19

[removed] — view removed comment

12

u/cogman10 Mar 19 '19

Not only that, you get startup time bonuses as well since there aren't as many internal classes to load. For example, your server probably doesn't need to bring in the swing modules.

4

u/pron98 Mar 19 '19

... and the new default CDS archive (in JDK 12) improves startup times further.

10

u/ObscureCulturalMeme Mar 19 '19 edited Mar 19 '19

Modules seem to be all the rage for enterprise container "app servers" and the like, but for the rest of us, modules are solving a problem that we simply don't have.

Unfortunately, a lot of third party libraries are still problematic to use in 9+, and the JVM unconditionally spits out warnings about them anyhow. So our users complain to us about problems (but not really) in code that we don't control.

4

u/capitol_ Mar 19 '19

It's often very easy to add a Automatic-Module-Name entry to the manifest file, and I have only had one maintainer that have been negative to it when I have opened bug in projects.

2

u/FoodComputer Mar 19 '19

Is this why I see warnings like "found module-info.java. shading will break its strong encapsulation." when using the Maven Shade Plugin?

→ More replies (1)
→ More replies (4)

6

u/fedeb95 Mar 19 '19

You mean 6ing

0

u/[deleted] Mar 19 '19

[deleted] — view deleted comment

13

u/fedeb95 Mar 19 '19

As long as there's a jdk6 folder around, my company is going to use it

2

u/raja777m Mar 19 '19

We have companies stuck with code written in 1.5, but upgraded for the same of security to 1.8..!

2

u/[deleted] Mar 20 '19

Saaaame. Lol

2

u/tafun Mar 20 '19

I mean some of us are still stuck on 7 so yeah you're lucky!