12 ms·
Java 25 officially released
- mkurz 1y agoNew Features: https://openjdk.org/projects/jdk/25/ https://openjdk.org/projects/jdk/25/ Java 25 is an LTS release.
- theflyinghorse 1y agoCan't wait to have a job migrating an application from 17 to java 25 in 10 years!
- gunnarmorling 1y agoI wouldn't expect migrating from 17 to 25 to be an awful lot of work. The hard bump was moving from Java 8 to 9+ (11, typically), due to the introduction of the module system, removal of APIs previously shipped with the JDK (e.g. JAXB), etc. Things get much easier once you've passed this hurdle. Adopting 17 posed another, usually smaller, challenge due to reflection not working OOTB like before, but I'm not aware of other, equally disruptive changes after 17.
- david38 1y agoExcept he didn’t say “for ten years” but “in ten years” referring to the extreme length of time companies take to upgrade
- lisbbb 1y agoHe meant "10 years from now" when the company absolutely must get off of 17.
- lisbbb 1y agoYou haven't done it, then. Just the re-testing of everything in these large companies is terrifying and complex. Particularly the real-time stuff like Kafka. Most companies refuse to update unless absolutely necessary as they see the solution as an investment that has to produce. Security concerns have changed that attitude somewhat, but you would be surprised how much re-work is often necessary. The frustration of sorting it all out is not worth the money, imho--I'd rather just do something else, so I am.
- vips7L 1y agoAlready doing the work to move my team to 25 and it's been out for a day.
- p2detar 1y agoI'm doing that in 2 weeks. The next major version of our product will require 25. edit: I wrote "require" when I meant "ship with". We ship a Temurin JRE together with our product, so it's being updated with each new installation.
- vips7L 1y agoNice! It really isn’t hard to stay on top of it imo. The only thing stopping anyone from upgrading is their own company culture at this point.
- theflyinghorse 1y agoYou still have to test everything.
- vips7L 1y agoWe do full testing before every release either way. There’s no excuse for not upgrading.
- mrsilencedogood 1y agoDamn, still not structured concurrency full release. Really looking forward to that one. Happy to see Scoped Values here though. That'll be big for writing what I'll call "rails-like" things in Java without it just being a big "static final" soup in a god-class, or having a god object passed around everywhere.
- jayd16 1y agoI hope structured concurrency ends up feeling better than async/await with less sugar. The examples do not instill confidence, but we shall see.
- pjmlp 1y agoUnfortunately on .NET side, TPL Dataflow doesn't get enough love.
- jayd16 1y agoThey added an async Channel and its actually pretty nice to work with, at least.
- colonCapitalDee 1y agoAgreed. This is how I feel using it: https://xkcd.com/297/ https://xkcd.com/297/. It's from 2012! I hadn't even written my first `public static void main(string[] args)` then. My favorite parts of TPL Dataflow are using Channels + Encapsulate to create custom blocks, backpressure, and parallel execution while maintaining ordering. Great library. I sometimes wonder if it would be possible/useful to implement a TPL Dataflow 2.0 on top of Channels.
- dionian 1y agoI would be shocked if they came up with something that made me want to move away from ZIO.
- dwaite 1y agoThe structured part is somewhat like using for and while loops rather than goto statements - it uses block scope to make it easier to reason about how concurrent code is compartmentalized. However, you still have concurrent code. The example given uses futures rather than async/await, and so the thread blocks waiting for these other threads to complete. The Java alternative to async/await is the virtual threads. Since they are not GC roots and the stack is a chain of heap-allocated objects, the idea is that they can have significantly lower overhead in terms of memory usage for small tasks. Rather than the compiler generating heap objects to store intermediate state, it just uses a virtual thread's stack. However, even without async/await syntax you still have equivalent concepts. Since the compiler doesn't have native structured concurrency, it is emulated by putting tasks in lambdas. You fork off subtasks, and do a blocking get() to resolve the futures for their results. Heavy use of fork(), run() and get() aren't necessarily better than async and await keywords. One concern I have is that Java virtual threads are supposedly preemptive, not cooperative. This means you will have less guarantees around concurrent modification than you would with a typical async/await system running cooperatively on an executor. Several languages willing to make more core changes around adding async/await have gone as far as to also integrate actor functionality to help developers write concurrency-safe code. I don't see Java being able to provide developer help/diagnostics here like other languages can.
- cryptos 1y agoNice overview of new features in Java 25: https://www.baeldung.com/java-25-features https://www.baeldung.com/java-25-features
- bootman 1y agoJava has been such an amazingly solid technological foundation... and for a long, long time! It may not be the most sexy language but it's been a stable one. We have applications created with Java 1.4 running happily on Java 21 LTS and expect to upgrade to this latest LTS (Java 25) soon. Java for the win!
- ilt 1y agoKind of tangential, I still remember Gmail app created in Java which used to run on my touch Symbian phone in 2009. It was cute as hell and got the work done.
- freedomben 1y agoNeat, I wrote some swing apps back in the day that I've thought about resurrecting, but didn't want to have to do much modifying since they are mostly toys, though useful to me. I'm gonna give it a try!
- ameliaquining 1y agoIs Swing good now? Usually when people say Java is good now I assume they're not talking about Swing.
- freedomben 1y agoNo, swing is pretty out of fashion if not deprecated. I know it pretty well, but still wouldn't choose it if starting a new project today. I'd use Qt, though if you're not comfortable with C++ I've been told JavaFX is pretty good
- deleted 1y ago[deleted]
- 112233 1y agoWhat is the current situation of using Java (from legal standpoint)? In open source and in commercial setting? Oracle has a lot of fantastic technology locked up in Java (things like Truffle), how reasonable it is for new projects?
- piva00 1y agoUse OpenJDK (or similar) and you are free from any Oracle shenanigans.
- ffsm8 1y agoI don't disagree (it is gpl licenced after all)- but it's worth keeping in mind that openjdk is still provided by oracle, too. And all the other variants ultimately just repackage it. So if oracle doesn't care about destroying the Java IP, it definitely could cut everyone off from updates going forward. I don't think they'll do so however, MySQL is still freely usable too, right? And that's oracle IP too. Might change if they ever get into financial troubles, but that's the same issue with all languages and frameworks.
- thuridas 1y agoAnd there is Amazon Correcto, Eclipse Temurin... Sure, that could stop to maintain it, but would put the power immediately in the hands of other companies with a fork That said, you always have oracle's greediness...
- giancarlostoro 1y ago> Sure, that could stop to maintain it, but would put the power immediately in the hands of other companies with a fork I have a feeling all those companies / orgs would band together to maintain it.
- pron 1y agoAmazon Corretto and Eclipse Temurin are developed and licensed by Oracle. They are just packaged and distributed by Amazon and IBM respectively. If you report an issue against them, the Amazon/IBM people will forward the issue to us at Oracle to resolve. BTW, I don't dispute that Oracle is greedy, but I find the suggestion that Amazon, IBM, Google, MS etc. are any less so laughable.
- BlindEyeHalo 1y agoCrazy that it took this long to allow parameter validation and transformation before calling super in the constructor. That was something that always bothered me because it felt so counterintuitive.
- delusional 1y agoEspecially because you were always able to bypass it by declaring a `static` function and calling that as part of the parameters to `super`: public Foo(int x) { super(validate(x)); } validate would run before super, even though super was technically the first statement in the constructor, and the compiler was happy.
- mystifyingpoi 1y agoThis is such a funny workaround, I like that. But it doesn't matter in any library or your own code, since factory methods are much better (simply because they have names).
- PaulHoule 1y agoI've been programming in Java since before JDK 1.0 and that was one misfeature that bothered me then but that I've long since learned to work around.
- extraduder_ire 1y agoWasn't that possible since java 22?
- cesarb 1y ago> Wasn't that possible since java 22? From what I've seen, most people only care about the LTS versions of Java. Which means that after Java 21 LTS comes Java 25 LTS. The same happens with Ubuntu (after 22.04 LTS comes 24.04 LTS).
- thewisenerd 1y agorecently pulled the trigger on a migration out of jdk8 we decided to bite the bullet and do 21 instead of 17; one of the reasons being 25 being just around the corner. as far as i can tell, the biggest hurdle is 8 to 11 (with the new modules system); but it's smooth sailing from there. the proof-of-concept was done with jdk17, but it worked as-is with jdk21 (except guice which needed a major version bump). (of course being with a jvm language instead of java itself also probably helped)
- MBCook 1y agoFor us 8 to 17 was tough due to a lot of things you weren’t supposed to be using going away (sun packages). But TONS of libraries did it anyway. And the move from javax to jakarta for a lot of things in there was also tough. If you could get through that, you’re golden. From what I’ve seen going to 21 or 25 look easy. They’re just adding features, the big upheavals of doing the long needed cleanup are over. I expect keeping up to date to be far easier from now on.
- cesarb 1y ago> For us 8 to 17 was tough due to a lot of things you weren’t supposed to be using going away (sun packages). But TONS of libraries did it anyway. AFAIK, these libraries did so because there was no alternative, and some of the changes in Java 9 and later were done to provide them with an alternative. The only thing left is Signal/SignalHandler, which AFAIK still has no alternative outside the sun.* packages.
- samus 1y agoThe move from javax to jakarta was not really connected to the changes in the language. It is very much recommended to not do these upgrades simultaneously.
- MBCook 1y agoRight. It was a copyright issue, I know. We didn’t do that one giant jump. We moved from 8 to 17 in one step, then in a separate step upgraded Tomcat requiring the jakarta changes later. I guess I tend to think of them as one “modernizing“ combo even though they’re not.
- miki123211 1y ago(not a Java developer, no dog in this fight) I'm not sure I like the module import system very much. I think `import *`-like constructions make code a bit easier to write, but much harder to read, especially for developers new to the language / codebase. C# and Nim love that style, and it makes them almost unreadable without a good IDE. Personally, I much prefer Python's "short aliases" style, e.g. `import torch.nn.functional as F`
- dionian 1y agoso module imports looks to be different from normal imports and actually helps reduce the number of imports the developer needs to write. FWIW Scala (which runs on java) does have import renaming and also type aliases which can do what you mentioned.
- keltex 1y agoC# supports the "using alias" like this: using Project = PC.MyCompany.Project; https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-directive https://learn.microsoft.com/en-us/dotnet/csharp/language-ref...
- deepsun 1y agoIn large codebases the main problem with imports is "where that thing comes from" -- you really want explicit imports. Especially if something broke in build and you're not sure you have correct versions of dependencies (what dependency that name came from). In small codebases anything would work. PS: why do you even look at imports? Any decent editor just hides it, you never need it, you navigate just by clicking/hotkeys on names directly from code.
- samus 1y agoAFAIK it's mostly intended to make writing single source file programs easier.
- bob1029 1y ago> C# and Nim love that style, and it makes them almost unreadable without a good IDE. I think a lot of what turns people off to the C# developer experience is not using full-blown Visual Studio. VSCode is great but I would never open csproj or sln files using it unless I needed to manually edit their actual XML contents. It's not broadly advertised that you can buy a perpetual & fully licensed copy for $500 [0]. No subscription or other cloudy scam stuff is required, although Microsoft's product pages will initially lead you to believe it is. [0] https://www.microsoft.com/en-us/d/visual-studio-professional-2022/dg7gmgf0d3sj https://www.microsoft.com/en-us/d/visual-studio-professional...
- lukev 1y agoMore new programs should be written in Java/on the JVM. Most of the reasons Java dropped out of popularity no longer apply, and at this point it is an incredibly stable and mature ecosystem. I can come back to a Clojure program I wrote ten years ago and it runs great, meanwhile a TypeScript program I write 6 months ago requires a bunch of updating and cleanup.
- wry_discontent 1y agoIn the circles I see, Java isn't popular because it's verbose and boring to use. These days I don't see those as significant issues, tbh. I would prefer a Clojure program, but I'll take Java over Typescript at this point.
- Sohcahtoa82 1y ago> it's verbose and boring to use. Python code that follows traditional Python paradigms is called "Pythonic". Java code that follows Java paradigms is called "awful". To be fully transparent, I've never written Java professionally, only for a couple small hobby projects 10 years ago, plus some while in school, so my opinion isn't worth the pixels you're reading it on, but I look at most Java code with abject horror. Endless levels of abstraction. The apparent inability to write a simple function and instead creating a "ThingDoer" class with a single function called "doThing". Run-time introspection and reflection EVERYWHERE. Stack traces that are just an endless stack of calls to functions like ".invoke" and ".run". I've been under the impression that all of that is a by-product of Java's strict type system, but someone please correct me. Why do Java paradigms seem so awful?
- robmccoll 1y agoI think a lot of it is the people using it and certain parts of the culture. There are a lot of Enterprise TM programmers that seem to believe as many layers of abstraction and as much verbosity as possible with little tiny methods that do practically nothing leads to better solutions. It is totally possible to write concise and pragmatic code with Java. One thing that will be a thorn in your side though is null handling. The traditional approaches increase line count and branching. The newer(ish) Optional-based null handling is quite verbose but in width.
- suyash 1y agoNice to see "Vector API (Tenth Incubator)" - it should open possibility of doing low level vector maths much needed by machine learning toolkit in Java.
- samus 1y agoIt's not that new though. It will probably only be frozen once value types arrive.
- palata 1y agoMy feeling (which is worth what it is worth) is that Java as an old language has been improving over the last 10 years, whereas C++ has gotten worse.
- alwahi 1y agoi think its time for some of the enterprise customers to maybe consider upgrading to java9?
- alwahi 1y agoi think some of the enterprise users should maybe consider upgrading to java9?
- fnord77 1y agoIt's a damn shame that project Valhalla still isn't finished. This would fix so much and open up java for better matrix math support
- joe_mwangi 1y agoIt was submitted recently 2 weeks ago hence we might see something in future releases too.
- samus 1y agoProject Valhalla is too big to land in just one release. Even if all changes to surface language and the JVM land, it's just the beginning for adding new optimizations.
- cryptos 1y agoThe first time I heard about Valhalla was 2014 (if I remember correctly), so more than a decade ago! However, I'm very happy how Java is engineered. It is really the exception that a technology is so carefully developed. Java is the technology you want for long-term stability.
- HackerThemAll 1y agoNo, thank you. I've never touched Oracle products in my entire career, and that's my no. 1 directive forever.
- Longlius 1y agoAs opposed to Google, Meta, and Microsoft?
- HackerThemAll 1y agoYes. I just decided some 20 years ago to never touch or learn Oracle products. Is it forbidden to do so? My career is fine without them.
- redditor98654 1y agoDo you use or have used MySQL in the past?
- Yhippa 1y agoI've been away from the Java world for the past 4 years, and I really miss it. I hope I can get back to it soon. This is cool: https://openjdk.org/jeps/512 https://openjdk.org/jeps/512 (JEP 512: Compact Source Files and Instance Main Methods). It will allow beginners to progressively ease into the language and remove arbitrary gatekeeping from the language itself. I also went down the rabbit hole on the Shenandoah GC JEP and learned that it was actually named after the Shenandoah Valley. Super cool.
- steve_taylor 1y agoDoes it have reified generics yet?
- froh 1y agowhat's the state of graalpy these days?
- ayewo 1y ago"The GraalVM team are transitioning to focus on non-Java Graal Languages including GraalPy and GraalJS. Details are expected to be announced later." Taken from: https://blogs.oracle.com/java/post/detaching-graalvm-from-the-java-ecosystem-train https://blogs.oracle.com/java/post/detaching-graalvm-from-th...
- lolive 1y agoWhoever criticises Java in the modern world will have to answer to this: if your IDE of choice does not provide a safe « Extract method » capability, then your langage largely sucks.
- aw1621107 1y ago> if your IDE of choice does not provide a safe « Extract method » capability, then your langage largely sucks. Why is that a language problem as opposed to an IDE problem?
- zbentley 1y agoWhen it’s Ruby or another language that uses metaprogramming to the point of complete obscurity to tools and humans.
- lolive 1y agoThe IDE is basically applying static code analysis methods to "understand" the code structure. Something that works extremely well in Java, reasonably well in Typescript, and seems quite shaky in other languages.
- aw1621107 1y agoFair point. Still think that that sole criterion is a bit arbitrary to judge a language on, but different needs for different people, etc., etc.
- joegreen 1y agoI was really surprised to find out that the support for the STR string templates that was added as a preview feature in Java 21 was completely removed in Java 23 and there is no replacement at all.
- al_be_back 1y agoThe verbosity of Java may certainly annoy/put off new devs a lot, but with advanced tooling and ai, that's not a biggie i think. Personally, i think a live-reloading feature would make java very popular again, and rapidly so. In my internship (mid-00s), a senior consultant said to me "remember, we don't sell Java, we sell Sun". I thought that was backward, preferring "we sell English, and England offers an implementation, or you could chose the US, or a Canadian alternative perhaps? etc". Little did i know. Java's from the era [1] of virtualization : machines, languages, web (with applets, flash etc) where you focus on writing code once, and delegate the running to a VM, reaching an ever growing list of platforms/devices the VM knew. But then came Steve book of Jobs and vajazzled so-called phones and desktops, far better than Bill electronic Gates. Why write an App in java and have that run [2] on Phones, Web, Desktop and Server when you can create N-code bases, one for each platform and device?? Oh and why would you want games in Flash [3] when you could be saving your battery to watch a cat tumble over a dog in 8K definition??? Seriously though, I think, the vm era is going to come back in the next few years, and expand into new areas, such as UI vm to deal with os/platform specifics. A healthy-level of tech decoupling is a good strategy, for everyone, but not full isolation. The vm model is much better for consumers and devs - far less lock-in, more future-proof [4], more freedom to innovate and try new markets. Usually, the vast majority of consumers and most devs have ordinary / run-of-the-mill issues. Most popular apps/sites are about shopping, basic entertainment, library-functions (search, referencing, reading), and chatting. [1] 80s/90s [2] with slight platform variations [3] Flash or some alternatives. Jobs banned Flash for security+energy consumption reasons. [4] abstract/wrap intricacies of lower layers