Live data from Hacker News

Java 17 / JDK 17: General Availability

mail.openjdk.java.net

161–170 of 251 posts

Re: Java 17 / JDK 17: General Availability

#161
post #121
post #62

Earlier quoted context omitted.

I really like the Kotlin approach, where they just embraced null being a fact of life on the JVM/JS and instead integrated nullability into the type-system [1]. C# and Typescript do something similar. So then you get the best of both world, the safety of Optional without the boxing overhead. [1] https://kotlinlang.org/docs/null-safety.html

This really sounds like the way to go, although of course it is too late for Java. Optional feels awkward, and there's no more safety than we already have since the JVM null-checks anyway. if( arg.isPresent() ) ... vs if( arg != null ) ... How is this better?

The main advantage is that Optional is inconvenient and forces you to consider the null case. It's easy to forget that values can be null and assume they're not, e.g. auto-unboxing

    Long getSomeValue();

    int max = Math.max(0, obj.getSomeValue());
The Optional value forces you to type some text basically acknowledging that the value can be null.

    Optional getSomeValue();
    ... obj.getSomeValue().get());
I'm not saying Optional is a great solution. It's essentially a notification that a value is nullable.

Re: Java 17 / JDK 17: General Availability

#162

Some other news in relation to the release: - (Proposal) Moving JDK LTS versions to a two year cadence [1]. Java 21 will be next LTS instead of Java 23. - Oracle JDK is now free for commercial and production use [2]. - A new Java developer site [3]. [1] https://mreinhold.org/blog/forward-even-faster [2] https://blogs.oracle.com/java/post/free-java-license [3] https://dev.java/

Thanks for the Dev.java mention. Our team is excited to launch the site. We focused on minimal design (similar to Inside.java) and heavy on content, mostly learning material to start. More to come soon. Feedback here is welcome!

The RSS-feed seems to be missing: https://dev.java/feed.xml (Linked in the footer.)

Re: Java 17 / JDK 17: General Availability

#163
post #117

Lately I have insight similar to 'what hardware improvements give, software bloat take it away', 'what JDK platforms give third party Java frameworks take it away. I have this misfortune of dealing daily with a nasty Java framework which converts compile time errors into runtime errors, single error trace with multiple stack traces , most of them being from framework itself. One thing that might improve situation is…

What do you think of vertx. It seems pretty lightweight set of server side libraries along with activej which also focuses on speed.

Re: Java 17 / JDK 17: General Availability

#164
post #157
post #8

Earlier quoted context omitted.

Starting from 1.6 they only showed the minor version number. So 1.6 = Java 6, 1.8 = Java 8, etc. I always assumed this was because .net (arguably it's main competitor) was churning fast through version numbers and they "wanted to keep up".

And now it is the other way around. C# burning through the versions to catch up the versions (and not so much the content). PS: had to edit, was really just a note about the numbers not the content of the versions!!!

Catch up to what? The JDK 17 JEP list reads like a list of things that were added to dotnet years ago.

Re: Java 17 / JDK 17: General Availability

#165
post #157
post #8

Earlier quoted context omitted.

Starting from 1.6 they only showed the minor version number. So 1.6 = Java 6, 1.8 = Java 8, etc. I always assumed this was because .net (arguably it's main competitor) was churning fast through version numbers and they "wanted to keep up".

And now it is the other way around. C# burning through the versions to catch up the versions (and not so much the content). PS: had to edit, was really just a note about the numbers not the content of the versions!!!

C# has never had to play catch-up with Java, it's always been the other way around.

Re: Java 17 / JDK 17: General Availability

#166
post #117

Lately I have insight similar to 'what hardware improvements give, software bloat take it away', 'what JDK platforms give third party Java frameworks take it away. I have this misfortune of dealing daily with a nasty Java framework which converts compile time errors into runtime errors, single error trace with multiple stack traces , most of them being from framework itself. One thing that might improve situation is…

There are plenty of frameworks. Check out Helidon, Quarkus, Micronaut as examples of modern frameworks. You might like them. They’re not bound to servlet API.

Re: Java 17 / JDK 17: General Availability

#167
post #134
post #110

anyone able to run Java 17 on a Pi ? wonder if there is an ARM release for Pi yet.

I built a Snap package of OpenJDK 17 and 18 for armhf (armv7l) and arm64 (aarch64), along with four other Linux architectures. See: https://snapcraft.io/openjdk

super!

Re: Java 17 / JDK 17: General Availability

#169
post #141
post #136

Earlier quoted context omitted.

Exactly, I hate dealing with Lombok projects for that reason. I'd rather the cruft than the compiler add-on.

Do you not just use maven? Any of the major IDEs will automatically configure annotation processors for you when they're configured in your pom. Similar for gradle.

I no longer think there is a justification for a project like Lombok. FreeBuilder/AutoValue (depending on your needs) will provide the same feature, but with clear visibility at the IDE level.

Re: Java 17 / JDK 17: General Availability

#170
post #63

Earlier quoted context omitted.

Another license change for the official oracle jdk? What's the trap this time? :-O

Only JDK 17 is free. Earlier versions are not.

Of the Oracle branded JDK releases, only version 17 (so far) is free.

OpenJDK (which is built from functionally the same source code) has been free under GPL v2.1 + Classpath Exception for a while now.

Post reply on HN