228 points · by tronotonante · 8y ago · 110 comments
https://www.opsian.com/blog/java-on-docker/
Relevant JEPs:
https://bugs.openjdk.java.net/browse/JDK-8146115
Thanks!
[0]: https://blogs.oracle.com/java-platform-group/java-se-support...
For example, 8u131 and 9 only supported cpu sets whereas 10 includes support for cpu shares. Available memory detection in 10 applies to the whole of the JVM rather than just the heap on 8u131 and 9.
Reading elsewhere they are apparently moving to a 6 month release cycle.
For people using Java in businessey environments, I'd love to hear your thoughts on this. Do you think you'll be able to keep up with the JDK changing twice a year? When I was in this game we were always on versions that were years behind, but maybe this has changed.
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.
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.
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...
Are they dropping support for the latest LTS just four month after releasing a new LTS? That sounds a bit harsh.
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.
So we basically just have 3 months to migrate to the next LTS version??
Teams in charge of software release whenever they want or can, clients are free to use whatever version whenever they want.
The problems only happen with breaking changes - and I haven’t seen a single case of Java breaking backwards compatibility (not counting cases where users intentionally used or relied on private implementation details).
Interested to hear which Java API you use which requires special modification in order to be compilable on Java 8?
Usually most of this breakage is caused by the com.sun stuff which isnt public API.
But then you are using a 1 year old framework (if you're lucky) that depends on a version of library X that is 2 years old that depends on a 3 years old library etc.
At the end of the chain you have a library that does low level stuff (bytecode instrumentation for example) and is a few years old. That is what may give you problems, and often the only practical solution is to update to a newer version of the framework, which can be quite expensive.
Because I worked at a fairly large tech company and every one of our applications required some amount of manual intervention beyond figuratively switching all the "7"s to "8"s. That's despite the fact that hardly any of them were doing anything particularly complicated, and absolutely none of them were doing anything involving hidden com.sun APIs. I think it's just a consequence of such a large build system.
If your company is only discussing moving to JDK9 now, what difference does it make that JDK10 is out? If you are using the free version, there is no real support. If you are a paying customer, Oracle will support you to the end of time while wringing every last cent out of your company.
What difference does it make if the language keeps evolving? Do you expect the entire world to revolve around you and your company?
See http://blog.joda.org/2018/02/java-9-has-six-weeks-to-live.ht... for more insight.
All good Java developers I know make all local variables final to force better code.
Person p = ....
p = doSomething(p)
...
p = doSomethingElse(p)
is hard to reason about when it should be Person p = ....
... lots of code
Person updated = doSomething(p)
... lots of code
doSomethingElse(updated)
Which is easier to read and understand. So you might have had bugs that would have been prevented with final, but you didn't attribute to final.You shouldn't be able to doSomethingElse(p) when you actually mean to doSomethingElse(updated).
That is to ease the pain of unwrapping nested types and error-checking intermediate steps so you don't have to come up with new names for each intermediate.
In the codebase I work on most, all variables that can be marked final are marked final. That means that whenever I see a non-final variable, I know that something tricky is happening and I need to be extra careful in reading the code.
So instead of typing:
AbstractConcreteFactoryFactory factory = new AbstractConcreteFactoryFactory();
You can just type it only once: var factory = new AbstractConcreteFactoryFactory();C# is a huge breath of fresh air compared to java largely because of useful type inference. It's easy to make compilers do more work now.
Rust is doing type inference with drastically stronger types, for example.
var p = new Person();
p = 1234; // This will trigger a compile time error`Simple<List<Map<String, Demo>, OtherList<Map<Int, String>>` is a little bit painful.
I use scala and basically most often at least public Methods should (in scala you can omit even that, however some functional libraries need a return type) have a explicit type, which most often is enough.
Does Java fill any kind of niche aside from maintaining those gargantuan projects that are typical of governments and large corporations?
When I learned Java in the 90s, it was hyped up with the promise of microwaves and refrigerators and televisions and every little thing running Java software.
Instead, the only time I've found myself turning to Java was when I built an IDE on top of eclipse for a custom programming language, a few android apps, a few swing projects for school, and a few socket based projects. When dealing with IOT and smaller hardware, I've found myself using node(js) instead.
I've rarely ever found it enjoyable. The IDEs have been sluggish, the GUI libraries have felt cheap and unpolished, with those clunky diamond shaped radio buttons, and I always found myself writing too much code to do very simple stuff, because every library was wordy and verbose. When I looked at my work, it felt inelegant and cumbersome.
What is Java like in 2018? Are there any good, polished open source projects that work well ? What would make you look at a project and say "I think Java is the most suitable choice for that" today?
*Still hoping Oracle will be so good to allow TruffleRuby download without all the signing up and agreement.
This is definitely coming very soon.
When Oracle will remove it in Java11, it would be even worse
So if you care about long term support, you should stay on JDK8
If it’s one thing we’ve learned in software it’s embrace the change. Little and often is the way to stop technical debt accruing