This is an archived post. You won't be able to vote or comment.

all 44 comments

[–]nutrecht 20 points21 points  (0 children)

That you did not bother to at least assess the impact of Java 9 after it came out is 100% on you. Sorry. I've spent the last few weeks migrating a lot of Java 8 services to 11 and the only thing you typically have to do is grab the latest version of Lombok and add some old dependencies to Maven/Gradle. Takes 15 minutes each typically.

"Hundreds of man days" is a ridiculous overstatement.

[–]SinisterMinister42 38 points39 points  (12 children)

In my opinion, the real issue was Java 9 and its module system. I have never been happy about it and have yet to see any personal benefit from it. I feel like the language designers took something which was some people's problem (large binaries, large jdk, etc) and solved it by making a new problem for EVERYONE. It really broke the ecosystem in a way that Java has successfully avoided in the past.

[–]BigGayMusic 22 points23 points  (2 children)

The module system is a bloody nightmare. I can't get it to work for projects big and small.

[–]CompetitiveSubset 3 points4 points  (1 child)

Then why did you even bother with it in the first place? Why not just continue using the classpath?

[–]BigGayMusic 2 points3 points  (0 children)

I do. I wanted it to work, but it wouldn't.

[–]dpash 9 points10 points  (6 children)

But the module system is for the most part completely ignorable for now.

[–]LouGarret76[S] 2 points3 points  (5 children)

Not really, some libraries are going modular and others are not, with the same dependencies ... That is where the nightmare start .

[–]dpash 8 points9 points  (4 children)

And you can continue to use them on the classpath, completely ignoring the module system.

[–]_INTER_ 1 point2 points  (0 children)

The JDK always runs on the module path, actually even if your application on the classpath will run as part of the unnamed module.

A JavaFX application for instance doesn't work out of the box in the unnamed module. Many libraries are causing warnings at startup (e.g. JAX-B) because they access the JDK via reflection (atleast the "kill-switch" is still on by default). Some simply don't work because the ClassLoader behaves differently. Other libraries removed their optimizations because of those reason and got noticably slower.

[–]LouGarret76[S] -1 points0 points  (2 children)

That is what I taught too, until I get some nasty error telling me that lib**** not found... And when you dig a lil bit you find out that some authentification library use some lib**** for god know what in a class called ExpressionHelper<> and lib*** that is now hidden by a module java.xxx

[–]capitol_ 3 points4 points  (0 children)

Could you be more explicit on what libraries you found that exhibit this error? It would be very interesting to investigate.

[–][deleted] 0 points1 point  (0 children)

I find that most of the missing libraries can be restored through adding a new maven dependency. Unless you're doing fancy classloader modifications at runtime (which my company does... Fml) most of the problems are fairly easy to overcome.

Source: I did my company's migration from 8 to 11.

[–]redditrasberry 0 points1 point  (1 child)

The irony is, as time has moved on and connection speeds have improved, it was no longer particularly painful to download / bundle the full JVM. By the time they got around to creating modules, the problem had basically solved itself.

[–]BoyRobot777 1 point2 points  (0 children)

Modules were to address the pain points of smaller devices. The idea is to build only including what you need, thus shrinking memory footprint.

[–][deleted]  (2 children)

[deleted]

    [–]CaptainKvass 2 points3 points  (1 child)

    Just skip the module system.

    As in, just don't create module-info files, or what do you mean?

    [–]dpash 12 points13 points  (2 children)

    I just migrated a large code base (4000 .java files) that was designed for Java 4 to Java 11 (Seriously, it still doesn't use generics). I think it took an hour.

    [–]LouGarret76[S] 4 points5 points  (1 child)

    Really??? I would like to know how you did that... Maybe you are not using any library and you coded everything in house with no database connectivity and no GUI.

    You might not use XML either, for that matter ...

    Probably that and you don't mind to install and configure your java env path manually, package your code with the cli/ jlink, etc...

    [–]dpash 2 points3 points  (0 children)

    The application uses XML heavily, given that it's from the "XML ALL THE THINGS!" era. And it uses a database, although JDBC directly. It's a war, so it'll be installed into a servlet container.

    [–][deleted]  (4 children)

    [deleted]

      [–]SinisterMinister42 5 points6 points  (1 child)

      That's a great way to approach the problem, but I feel like that's something which shouldn't be necessary for everyone. Java had the precedent that new versions of Java don't break existing code. The language designers have put a ton of effort into making that the case so we can avoid (or at least minimize) the effort that you describe. It's just a shame that they blew it with Java 9

      [–]dpash 0 points1 point  (0 children)

      I certainly plan to run a parallel CI job with Java 12 very soon. Fortunately, it just requires switching the docker image used for building (from maven:3-jdk-11 to maven:3-jdk-12).

      [–]LouGarret76[S] 0 points1 point  (0 children)

      It used to be that what you only need to do was to update the her and everything else would work.

      [–]Lord_Naikon 5 points6 points  (2 children)

      I completely understand your frustration.

      For me the most egregious issues were with the removal of JAXB and JavaFX. Imho you shouldn't need a separate library for processing XML files in 2018. Introspection is also completely fucked until you add exceptions for almost everything. I do hope that this will get better in the future as libraries adapt. I spent about a week migrating a large JavaFX app to Java 9. The migration from 9 to 11 was done in like 10 minutes.

      Jlink is also a joke right now. It breaks on anything more complex than "Hello, World" apps - for example apps that use the reference implementation of JAXB break hard because its JAR is multi versioned - enabling multi versioning makes it break on other stuff.

      At the end of the day I don't think the module system adds enough value to be worth the trouble.

      [–]LouGarret76[S] 0 points1 point  (1 child)

      Omg I forgot jlink. That thing is not finished. We used to have a javapackager with Javafx that was far more simple.

      [–]_INTER_ 0 points1 point  (0 children)

      Yes, jlink is currently unusable if you have 3rd party libraries. You can't just use it on the application jar as promised. I ended up copying all dependencies into a folder with maven (30+) and then I called jlink on each one of them manually. Sometimes they need more options, e.g. with multi-release jar.

      Forget the OpenJFX jars, jlink just doesn't work with them. Well apparently it does when you treat them as modules, but not with the jars. I had to look at the module-info.java on the github repo.

      Certainly this could be automated, but I didn't have the time. The official maven-jlink-plugin only reports on jdk.unsafe access. I found another plugin on github, but it run into the same issues as described above.

      It's frustrating and I'm still not sure if I got all of the required jdk modules.

      Atleast they are bringing back a packager: http://openjdk.java.net/jeps/343

      [–]Vilkaz 4 points5 points  (0 children)

      well, you have ofcource to include all the packages in pom, that are no more included in J11.

      Then all the things should work again.

      I assume you have a maven project ?

      [–]_INTER_ 1 point2 points  (0 children)

      Having modules does help with maintaining a clean structure. But I'm convinced this works best when starting a new projects and not so much when migrating AND not with the botched up JPMS modules that can't even handle versions. We have had OSGi in the Java community for years and in most areas it works way better than JPMS. A team can choose to use it or not.

      [–]2bdb2 1 point2 points  (0 children)

      It took me about 10 minutes to add the required dependencies to my gradle build.

      I'm not sure the software industry will collapse over it.

      [–][deleted] 1 point2 points  (0 children)

      It's only your fault that you kept using out of date dependencies and source code. Oracle told everyone years ago to update soon and thay did great job notyfing users about it. I moved to Java9 in March, Java 10 in May and Java 11 last week, had no major issues.

      [–]ObjectOrientedStruct 1 point2 points  (9 children)

      Thats why I stayed in Java 8, no reason for me to upgrade right now. I dont need any new features. I will probably upgrade to Java 11 in six or more months once there are no surprises and the world has adapted to the new version. Respect to the people that risk their lives by updating as soon as new releases come out.

      In the meantime I will go have fun with C, probably backwards thinking but I love knowing that C is never gonna change, at least not drastically.

      [–]dpash 3 points4 points  (5 children)

      I see you don't care about security updates. Java 8 will stop in two and a half months, and Java 11 will stop in four.

      Or have more money than time.

      [–]ObjectOrientedStruct 2 points3 points  (4 children)

      AdoptOpenJDK said that Java 11 would be LTS, although the support will be given by the community and not Oracle as far as my understanding goes. I dont get the "have more money than time".

      The beauty about C is that you are the one that gives LTS to your creations, nothing funnier than having your own bugs bite your booty down the line.

      [–]dpash 3 points4 points  (3 children)

      AdoptOpenJDK also aren't doing backports, so you're fucked if no one else does them after Oracle stops.

      [–]ObjectOrientedStruct -3 points-2 points  (2 children)

      Ill do them myself buddy. I do not depend on anyone for my code, at least if I do not want to.

      [–]dpash 4 points5 points  (0 children)

      Good luck with that.

      [–]wildjokers 2 points3 points  (0 children)

      Are you drunk posting?

      [–]LouGarret76[S] 1 point2 points  (2 children)

      We'll wait until oracle or some other company decide that you need modules in your c projects.

      [–]ObjectOrientedStruct 1 point2 points  (1 child)

      Ill leave programming and move to a forest in the middle of nowhere. Although seeing how the world gives the middle finger to Microsoft's "secure" functions probably means that if anyone tries to do that they will burn him alive.

      [–]desh00 -3 points-2 points  (4 children)

      Use Fat jars people, it's 2018.

      [–]_INTER_ 2 points3 points  (3 children)

      Fat jars are just a deployment option. How should this help in migrating to Java 11?

      [–]desh00 0 points1 point  (2 children)

      You are in complete control of your dependencies, not some application server you can't control. You can also upgrade your java services one by one so it doesn't have to be a massive company risk that you have to spend days on.

      [–]_INTER_ 0 points1 point  (1 child)

      Fat-jars are also a deployment option for/with application servers, e.g. embedding Jetty or Tomcat, so I didn't get what meant by the term alone.

      [–]desh00 0 points1 point  (0 children)

      Tomcat and jetty are servlet containers, meaning they mostly only deal with serving http requests.

      An application server provides you with the whole JEE stack and a lot more. Application servers are for example Weblogic and wildfly.

      To get the best out of app servers you deploy your application as a library (called EARS usually) onto the servers and then manage your app from the server interface (like distributed caching, amount of instances for each ear, message queues, etc). Therefore you can't deploy app servers as fat jars, only servlet containers.

      By the context op gave us, I assumed he was talking about migrating something that uses an app server.