News for hackers. Stuff that matters.
Re:JDK 10: General Availability by akerro on Wednesday March 21, 2018 @06:14AM (#16636744)
>This release cycle makes no sense to me. We haven’t even finished migrating all our components to compile with JDK8 yet

Why is it Oracles fault that you keep your components on Java version that has been deprecated and support dropped 4 years ago?

>What company with a reasonably large software base is going to keep up with a six-month release schedule?

What? No. That's now how it works. Every 3rd release is LTS and it support time is between 6 and 11 years as so far discussed. Java8 won't be supported after January 2019, Java11 (LTS) will be release in September this year.

> Java isn’t a web browser or some other user application. Who would even _want_ to spend the kind of resources required to constantly be testing new JDK releases?

You're not supposed to be testing it. You're supposed to write code to a contract, contract won't or shouldn't change. If you write code that follows implementation instead a contract (let's say you relay on HashSet order - I've seen it), it's your fault. We always make sure we write code that follows the contract. We're migrating our code base to Jigsaw now, after Spring 5 and SpringBoot1.5 were release with updated dependencies. If Spring and Tomcat teams made it available earlier, we would be on Java9 months ago.

Re:JDK 10: General Availability by derriz on Wednesday March 21, 2018 @08:12AM (#16637320)
Linus may be occasionally obnoxious but I believe his "don't break user space" mantra is a significant reason why Linux is so popular. A similar attitude guided Windows development (until Vista) and it dominated the desktop world. In comparison your attitude seems user hostile to me. No "user" is interested in comparing theoretical specs with the behaviour of the reference implementation. They just want a tool to deliver solutions that work.

For the first time in years, I'm looking at alternatives to Java for my next project. Java was always seemed to offer a pragmatic compromise in terms of language design and features and the availability of developers and libraries. Rapid breaking releases destroys most of the value of Java for me.

Re:JDK 10: General Availability by akerro on Wednesday March 21, 2018 @09:35AM (#16637845)
>Rapid breaking releases destroys most of the value of Java for me.

Almost nothing is broken in Java. Jigsaw modified who to use reflection to access data in an insecure manner. You should not be doing that in the first place for obvious reasons. But the code that was using reflection still works, you just get a warning when starting an application. That's all.

>No "user" is interested in comparing theoretical specs with the behaviour of the reference implementation

So you're probably not going to write any code in any strong-typed programming language, all of them have some kind of contracts you should/have to follow.

Do you know that Oak source code (what Java was called before) still compiles and runs in Java10?

Re:JDK 10: General Availability by derriz on Wednesday March 21, 2018 @10:54AM (#16638495)
I'm not sure how you can confidently assert that "almost nothing" breaks with Java 9. Maybe we were just unlucky that the very first application (a simple less than 20KLoC JavaFX Gui) we used to test upgrading to Java 9 broke immediately. But actually googling "Java 9 breakage" returns a ton of results so I guess our experience wasn't an outlier.

You are just repeating that it's fundamentally the user's fault because they "should not be doing that". A properly designed tool prevents incorrect usage. If a version of Java allows you to do something and that something proves to be very useful to GET THE JOB DONE, then I'm with Linus - the blame is not with the user.

For example, there was simply no alternative to using Unsafe in the past to get reasonable Java performance for certain task. The fact that it was there allowed me to resist the pressure to move a significant part of our codebase to C++. Of course we "should not be doing that" (using Unsafe) but the alternative was abandoning a large existing code base and hiring a bunch of C++ experts or retraining our existing developers or spending 10 times as much on our server capacity. Using Unsafe was a simple pragmatic decision. You cannot say it was "wrong" without knowing all the factors that went into the decision.

This is why I like Linus' stance in this case.

Re:JDK 10: General Availability by throwaway2048 on Wednesday March 21, 2018 @11:19AM (#16638765)
For what its worth, every single java application I use broke entirely with java 9.
Re:JDK 10: General Availability by ljw1001 on Wednesday March 21, 2018 @02:10PM (#16640829)
My only experience with it was after giving a Java 8 jar to someone who ran in on a Java 9 jvm and it crashed immediately.

This is the first time that has happened to me in nearly 20 years of using java.

Re:JDK 10: General Availability by hyperpape on Wednesday March 21, 2018 @09:32AM (#16637827)
There are long term support releases. I suspect that most enterprise places will end up using only LTS versions.

The real killer with the six month releases is not that they're every six months. That's doable. The killer is that they have zero support (even for security issues, I believe) once the next release comes out. As a result, you have to be ready to switch immediately. If you could upgrade to Java 10, then wait twelve months and go to 12, it would be less painful.

Re:JDK 10: General Availability by Yeroc on Wednesday March 21, 2018 @02:46PM (#16641158)
Yeah, the lack of overlap in support between LTS releases is the real killer. I predict that in 5 years there will be few people using the Oracle JVM. People will migrate to the JVM supported on their OS (for example, RedHat supports OpenJDK for the life of the OS as part of their OS/middleware offerings).
Re:JDK 10: General Availability by yaseenk on Wednesday March 21, 2018 @09:29AM (#16637806)
Java is backwards compatible though. Code that was written in the 90s will still compile and run on JDK 10.

It’s just now Java gets to iterate and improve more frequently and regularly.

Regardless there are still LTS releases (every 3 years) for people who lean more conservative.

Re:JDK 10: General Availability by evgeniysharapov on Wednesday March 21, 2018 @09:50AM (#16637938)
Not always and not quite. Here's an example of some type-foo with generics that works on Java 7 and not on Java 8

https://stackoverflow.com/questions/34659055/java-8-incompat...

Re:JDK 10: General Availability by hyperpape on Wednesday March 21, 2018 @11:12AM (#16638682)
If I read that correctly, the “breakage” is a bug fix, as that particular Java 7 compiler isn’t behaving according to the spec. You can argue that breaks backwards compatibility, but in the smallest, most innocuous way possible.
Re:JDK 10: General Availability by kelnos on Wednesday March 21, 2018 @12:43PM (#16639832)
My understanding after reading the answer to that SO question is that the behavior in 7 was a bug. New releases of javac aren't required to be bug-compatible with previous releases.
Re:JDK 10: General Availability by oblio on Wednesday March 21, 2018 @10:55AM (#16638509)
> In comparison your attitude seems user hostile to me.

Who care about his attitude? Is he the BFDL of Java or something? :)

On a separate note, good luck moving away from Java to a platform with better backwards compatibility! There's a reason Java is used for enterprise software, it's one of the best platforms for keeping compatibility. It's probably not perfect, but the others are just worse :)

Re:JDK 10: General Availability by derriz on Wednesday March 21, 2018 @11:10AM (#16638663)
I guess he cares (he spent the time expressing it in writing) and I care (I took the time to respond) :)

Also I'm not considering alternatives just because Java 9 broke stuff. There are lots of other reasons why Java irritates me but I felt it was still a winner when you balance up all the factors. But if backward compatibility is no longer going to be prioritised, then this shifts the calculation so that it's at least worth it, in my mind, to evaluate alternatives. So we're going to try Kotlin on a fairly small self-contained project.

Re:JDK 10: General Availability by lovelearning on Wednesday March 21, 2018 @07:26AM (#16637060)
"Contract won't or shouldn't change" seems unrealistically idealistic to me. Java migration - or any platform for that matter - is not just migrating its language features but also its ecosystem - runtime, VM, GC, frameworks.

There are many examples of migration problems for any platform - just have to google it. When information that can challenge our assumptions is just a google search away, I don't see why one should hold on to blind faith in idealistic assumptions. Here's one writeup of a system whose performance suffered simply by migrating to Java 8 without involving any code changes [1].

[1]: http://engineering.indeedblog.com/blog/2016/09/job-search-we...

Re:JDK 10: General Availability by badpun on Wednesday March 21, 2018 @06:43AM (#16636875)
Enterprise Java is mostly about writing glue code that combines dozens of libraries and frameworks. How can you tell (without testing) if tens of millions of lines of code in those libraries are not doing anything stupid, like depending on implementation instead of contract?
Re:JDK 10: General Availability by javajosh on Wednesday March 21, 2018 @08:03AM (#16637258)
The most important contract, the JVM spec, is really good in Java, and that makes up for almost everything. Javalang and the standard library is generally very good about maintaining backward compatibility (almost to a fault, some would say). Of course, there is code in the wild that depends on, for example, the com.sun packages and so on, and that extend the JVM using JNI - in those cases, all bets are off. But that was always true, and I'd argue that such contortions are generally as ill-advised as they are rare.

So, yeah, I think a faster release cadence is a good idea! Upgrading the runtime should be as simple as upgrading any other dependency.

Re:JDK 10: General Availability by pgsandstrom on Wednesday March 21, 2018 @07:16AM (#16637024)
> Java8 won't be supported after January 2019, Java11 (LTS) will be release in September this year.

Are they dropping support for the latest LTS just four month after releasing a new LTS? That sounds a bit harsh.

Re:JDK 10: General Availability by akerro on Wednesday March 21, 2018 @07:22AM (#16637042)
This is all subject to change, but so far it looks like it

http://www.oracle.com/technetwork/java/eol-135779.html

Re:JDK 10: General Availability by mason55 on Wednesday March 21, 2018 @10:47AM (#16638434)
This is my only problem with it. I can’t imagine it stays like that. I feel like there has to be at least a year of overlap between release of one LTS and deprecation of support for the previous one. Or at least a commitment to continue with security patches for longer (while stopping bug fixes and enterprise support)
Re:JDK 10: General Availability by Yeroc on Wednesday March 21, 2018 @02:48PM (#16641173)
You'll be OK as long as you're dropping off suitcases of money at Oracle's door, but currently it appears that freely available fixes/security updates will cease as soon as the next LTS is released.
Re:JDK 10: General Availability by u02sgb on Wednesday March 21, 2018 @11:36AM (#16638976)
I would be surprised if that's the case for paying customers...
Re:JDK 10: General Availability by piokoch on Wednesday March 21, 2018 @06:42AM (#16636871)
If that were so simple. What if your software gets deployed on an application server? If you upgrade, you need new support contract, this costs money plus leads to possible deployment/config changes, for instance going from JBoss 5 EAP to JBoss 6 EAP is not a pleasant experience as almost all configuration was radically changed.

What if part of your application is audited and certified by some regulatory body, when you upgrade, you need to go through the process again.

Java value is stability, you can assume your software will run for 20 years without touching it.

Re:JDK 10: General Availability by dragandj on Wednesday March 21, 2018 @07:20AM (#16637036)
No one is forcing anyone to upgrade. What worked on Java 8 3 years ago, will work on Java 8 in 17 years. If your team have extra requirements (audit, certification etc.), it seems it sells enterprise software. All those things cost money, but I assume you also charge money. So, what's exactly the problem? It is a bit naive to expect to get ultra stability for free from your suppliers, but charge top dollar from your customers...
Re:JDK 10: General Availability by coldtea on Wednesday March 21, 2018 @07:42AM (#16637140)
>No one is forcing anyone to upgrade.

No, but they are restricting them from updating as easily as before -- unless they cough up dough.

Re:JDK 10: General Availability by oblio on Wednesday March 21, 2018 @10:58AM (#16638540)
How are they restricting the updates? I'm not sure I understand.
Re:JDK 10: General Availability by coldtea on Wednesday March 21, 2018 @11:42PM (#16645514)
By only providing fixes and security patches for a few months -- after that you need to move to the next version (with all that entails testing and adapting wise for large codebases), or you pay for enterprise support and get support for years.

Before you could go to any version and expect it to be supported for years.

Now, if you dare go to some version above 8, you're supposed to either pay (for long term support), jump directly to the next version after a few months, or stay without security fixes.

(Or go OpenJDK and screw them).

Re:JDK 10: General Availability by earenndil on Wednesday March 21, 2018 @11:36AM (#16638978)
> Java8 won't be supported after January 2019, Java11 (LTS) will be release in September this year

So we basically just have 3 months to migrate to the next LTS version??