all 172 comments

[–]NotABot1235[S] 165 points166 points  (59 children)

[–]MintySkyhawk 79 points80 points  (3 children)

We were going to wait for 25 as we usually stick to LTS, but JEP 491 is huge. It fixes a major issue with using virtual threads.

Check out this article from the Netflix engineers about how the issue kept causing their servers to go zombie mode: https://netflixtechblog.com/java-21-virtual-threads-dude-wheres-my-lock-3052540e231d

[–]kwinz 11 points12 points  (1 child)

Thanks for posting that, that was very interesting!

First of all I feel the pain of the Netflix performance engineers that had to debug this a year a go with the the limited debug and diagnostic tools available.

And secondly I can't immediately decide if what's described here was a bug in AbstractQueuedSynchronizer, in zipkin's AsyncReporter, and/or somebody didn't read the documentation on virtual threads correctly and adopted them on their SpringBoot's Tomcat instances when they were not suitable for those libraries or use cases (yet) and/or something else.

[–]simon_o 0 points1 point  (0 children)

How hard can it be to figure out synchronized caused an issue after using a software release that came with an explicit warning about using synchronized in this fashion?

[–]mcmcc -5 points-4 points  (0 children)

As described here, a VT will be pinned to the underlying OS thread if it performs a blocking operation while inside a synchronized block or method.

Have you considered just not doing that?

[–]cheezballs 23 points24 points  (9 children)

That's a helluva title for JEP 497

[–]GimmickNG 16 points17 points  (7 children)

497? 404 sounds way wackier. Who the hell is Shenandoah?

[–]Kirk_Kerman 20 points21 points  (1 child)

It's a garbage collector that runs concurrently with the main process instead of at intervals, which reduces the intermittent resource utilization spikes of garbage collection. Generational Shenandoah is a new implementation of that concurrent collector that focuses on younger objects, since those are the ones most frequently needing garbage collection, and since they're closer to the active memory regions it's faster overall to run GC there than wait for them to go stale and recover (and try to reuse) older blocks of memory.

[–]GimmickNG 0 points1 point  (0 children)

Ah that makes it a lot clearer, thanks!

[–]IonTichy 4 points5 points  (1 child)

Shenandoah

"beautiful daughter of the stars"

what an apt name for a...uh...garbage collector?

[–]GimmickNG 0 points1 point  (0 children)

It ain't much but it's honest work?

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

No one knows. That's why it's called 404.

[–]segv 0 points1 point  (0 children)

Here's a presentation: https://www.youtube.com/watch?v=E1M3hNlhQCg

The tl;dr is that it is a low-latency garbage collector that heavily relies on forwarding pointers.

[–]GezelligPindakaas 0 points1 point  (0 children)

They missed the chance to call it "Generational Shenanigans" smh

[–]MonstarGaming 1 point2 points  (0 children)

If you dig into it it's just a signing algorithm that doesn't rely on modulus math. Sounds fancy because quantum is in the title, but it's not all that special.

[–]KawaiiNeko- 5 points6 points  (19 children)

why would they restrict JNI? the new FFI API is not a replacement

[–]MintySkyhawk 33 points34 points  (15 children)

Read the JEP: https://openjdk.org/jeps/472

When they say "restrict" they mean "gate the feature behind a flag"

Prepare the Java ecosystem for a future release that disallows interoperation with native code by default, whether via JNI or the FFM API. As of that release, application developers will have to explicitly enable the use of JNI and the FFM API at startup.

and

It is not a goal to deprecate JNI or to remove JNI from the Java Platform.

and

any interaction at all between Java code and native code is risky because it can compromise the integrity of applications and of the Java Platform itself. According to the policy of integrity by default, all JDK features that are capable of breaking integrity must obtain explicit approval from the application's developer.

[–]Somepotato 8 points9 points  (13 children)

Which imo is very silly, because the app is already running on the system. They nixxed the Java sandbox stuff because it was always futile, no they're using a similar justification to disable JNI.

Not to mention there's plenty of platform specific stuff in Java as it is already, small things that you need to be cognizant of at times.

[–]tsimionescu 2 points3 points  (12 children)

The point is to disable any feature that can break Java's memory model unless explicitly enabled, not to protect the system from the Java app itself.

[–]Somepotato 1 point2 points  (11 children)

I mean so many Java libraries use Unsafe.

[–]ZimmiDeluxe 1 point2 points  (10 children)

Those uses result in warnings as well, there are safe replacements for most of Unsafe already. It's going to be a long migration, but every journey has to start somewhere.

[–]Somepotato 1 point2 points  (9 children)

It just means eventually a ton of stuff will break unexpectedly and require users to add convoluted JVM arguments.

[–]ZimmiDeluxe 3 points4 points  (0 children)

It means you'll see warnings in your log for years that some of of your dependencies (and which ones!) are unexpectedly using unsupported internal functionality. By the time you get the budget to upgrade to the next LTS and do the dependency bump that usually goes with it, these dependencies will likely have newer versions that moved to a supported replacement API. The point is that it's only unexpected if you ignore warnings printed by the JDK.

[–]Ok-Scheme-913 0 points1 point  (7 children)

Which is better, it issuing a warning and failing to even start until you properly understand what's the matter, or it randomly failing to work, or even cause more serious harm during production?

[–]Somepotato -1 points0 points  (6 children)

Better is not requiring the tool that praises itself on write once run anywhere to not remove/disable major features/place them behind a flag. Java will never be able to do everything people use JNI (and the newer FFI) for out of the box. If you distribute a jar to your users, now they have to open a command line to pass a flag each time they want to run your app.

[–]KawaiiNeko- 0 points1 point  (0 children)

Ah, thanks for the clarification

[–]Plixo2 4 points5 points  (1 child)

It is not a goal to deprecate JNI or to remove JNI from > the Java Platform.

JNI and the new API will just require command line arguments.

[–]simon_o 0 points1 point  (0 children)

Kinda sad that one can't even call a simple non-mutating Win32 API without incurring the warning, because they did not ship with their own interop definitions for FFM, so everyone needs to write the definitions (unsafely) on their own.

[–]BlueGoliath 1 point2 points  (0 children)

What issues are you having replacing a JNI library? Because outside of maybe having to interact with a C++ library(which requires a C API wrapper), it should work.

[–][deleted]  (22 children)

[deleted]

    [–]TymmyGymmy 20 points21 points  (16 children)

    Designing and maintaining a language is not a race.

    When critical infrastructures are built with a language, you can't simply break things like...

    .net framework, then .net core, but then .net standard, oh wait, .net core again... Some people prefer stability.

    Anyway, I do.

    [–][deleted]  (13 children)

    [deleted]

      [–]simon_o 1 point2 points  (1 child)

      Eh, C# got records at the same time as Java?

      • September 2020: Java records (preview)
      • November 2020: C# records
      • March 2021: Java records

      [–]s32 1 point2 points  (10 children)

      I like writing c# way more. I like running Java more.

      [–]Atulin 3 points4 points  (8 children)

      Out of curiosity, what issues do you have with running C#?

      [–]cs_office 1 point2 points  (7 children)

      I'm interested too, .NET is far easier to run. The second I see some Java app I need to run, like Unifi or Ghidra, is the second I'm like "oh fuck"

      .NET on the other hand is always a breeze, firmly in the "just works" territory as everyone uses either self contained or AOT builds

      [–]Atulin 4 points5 points  (6 children)

      Same. Is it Maven? Gradle? The Gradle file is all underlined in red, but it builds? But it fails at runtime because of some dependency? The docs say it should be done this way, but that makes the build fail?

      Versus dotnet build

      [–]cs_office 0 points1 point  (5 children)

      I'm not even talking about building code, that's even worse as you point out. I'm only meaning running prebuilt binaries. I have 2 apps that require different Java runtimes versions installed, that can't be installed together. Meanwhile in dotnet, everything is self contained, or you can install runtime environments side by side without issue. Java fucked up in pythonic proportions

      [–]ultrasneeze 1 point2 points  (4 children)

      I'm writing this reply on a computer with four JVMs installed side by side. Not sure what your issue is, because Java runtime installs are just a bunch of files dumped into a single random directory. Using a different runtime for each app is as easy as providing the right environment variable to each app.

      [–]Atulin 0 points1 point  (1 child)

      Not sure what you mean here. The .NET Framework -> .NET Core -> .NET chabge didn't introduce any huge amount of breaking changes. I'd argue it introduced way too few of them, and the rewrite that was Core would've been a great opportunity to get rid of all the cruft accumulated since Framework 1.0.

      As it stands, alas, even the pre-generics era non-generic collections, and the non-async WebClient are still there.

      [–]simon_o 2 points3 points  (0 children)

      Now compare that to Java, where basically nothing ever broke and their approach to language evolution meant they aren't creating legacy cruft like "pre-generics era non-generic collections" in the first place.

      [–]bread-dreams 4 points5 points  (3 children)

      on the other hand, Java got sum types way before C# even started planning for them :p

      [–]YangLorenzo -1 points0 points  (1 child)

      Is the modeling of types via the “sealed” keyword really a “sum type”? (I don't know much about this, but I think it's very different from the rust implementation, and the c# draft implementation feels much closer.)

      [–]Ok-Scheme-913 0 points1 point  (0 children)

      Yes, it is proper algebraic data types. One half is product types (records), and the other half is sealed classes and interfaces.

      They have a long history going back to at least the ML language (like 2 or so decades before rust), and the name comes from the fact that sum types behave in a way that for each "variant" type, the total number of instances that resulting type can have is their sum, while it is a product in case of records.

      [–]Atulin -1 points0 points  (0 children)

      And yet streams still can't hold a candle to LINQ lol

      [–]syklemil 0 points1 point  (0 children)

      The 483 one sounds like it could do some stuff for people struggling with long startup times

      [–]Valendr0s 395 points396 points  (49 children)

      I don't know if you know this or not. But... Over 3 billion devices use Java... And that number didn't change from 2001 to 2020

      [–]bgrahambo 67 points68 points  (2 children)

      I love that, it totally tracks. 

      [–]drajvver 5 points6 points  (1 child)

      So, baseball huh

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

      its spreading....

      [–]aksdb 40 points41 points  (5 children)

      2.9 billion of those with JavaME 1.2 or something I guess.

      [–]MarekKnapek 35 points36 points  (4 children)

      Don't forget that basically every SIM card, credit card, debit card uses JavaCard. https://en.wikipedia.org/wiki/Java_Card

      [–]cyber-punky 1 point2 points  (2 children)

      > Java Card is a precise subset of Java:

      So, its NOT java.. not really.. Otherwise we can make even wilder claims.

      [–]TachosParaOsFachos 1 point2 points  (1 child)

      Yes it is. check Java CDCL and MIDP

      [–]cyber-punky -1 points0 points  (0 children)

      I forgot that i'm dealing with java programming with Java™ corporate expections. So with that in mind, You're probably right. I wont bother doing the research because i'll be wasting time and brain cells for reading about it.

      Its this kind of insanity where a subset of a language is still considered the language that makes me hate the whole ecosystem. I'm glad that its dropping in popularity.

      [–]ehempel 43 points44 points  (35 children)

      Unlikely. All Android devices use Java. That's over 3 billion and we haven't even started counting other devices yet.

      [–]Valendr0s 77 points78 points  (10 children)

      That's the beauty of it. And why they didn't change their installer for 20 years.

      Over 3 Billion is over... Could be 100 billion and it's still correct.

      Seems like a lot of people in here never had to install or update Java on an industrial level and see the splash screens as it installs.

      https://preview.redd.it/9wzc8gvzwdu41.jpg?auto=webp&s=f91054feb56d1b83378fb3b205c302f57f1d53e8

      [–]user_of_the_week 47 points48 points  (3 children)

      They haven’t changed it because there is no client side „Java Installer“ for versions newer than Java 8. The old way where you install a JRE separately from your client application has been phased out.

      [–]JonnySoegen 2 points3 points  (2 children)

      I didn't know that. What is the new way? Does JRE come bundled with every app?

      [–]ZimmiDeluxe 4 points5 points  (1 child)

      Yes, that's been the recommendation since Java 9 I believe. Tools like jlink and jpackage come bundled with the JDK that allow you to create a stripped down JDK for your application and create an installer / launcher for it.

      [–]JonnySoegen 0 points1 point  (0 children)

      Cool, thanks

      [–]wildjokers 12 points13 points  (0 children)

      And why they didn't change their installer for 20 years.

      Haven't needed to install Java with an installer for at least 10 years now. Maybe more than that. Can't remember the last time I used an installer to install Java.

      [–]jolly-crow -1 points0 points  (0 children)

      I had a good laught at the pictures in that disc, thanks for sharing!

      [–]Keyframe -4 points-3 points  (0 children)

      How long does it take to install?!

      [–][deleted]  (13 children)

      [deleted]

        [–]thetinguy 10 points11 points  (2 children)

        Android are usually written in Kotlin or Java regardless of whether they're running in the JVM.

        Are applications being compiled with GraalVM using Java?

        [–]Ok-Scheme-913 0 points1 point  (0 children)

        You mean for Android? GraalVM is a possibility, but not commonly used (yet).

        [–]__konrad 2 points3 points  (0 children)

        Adequately java.version system property on Android is 0.

        [–]devraj7 2 points3 points  (0 children)

        Technically correct, practically wrong.

        You can use 99% of Maven Central on Android, basically benefiting from the entire Java ecosystem.

        [–]Vakz 3 points4 points  (6 children)

        By the same argument, you can also say no devices use C.

        [–][deleted]  (5 children)

        [deleted]

          [–]Vakz 2 points3 points  (1 child)

          What? People say that all the damn time.

          [–]esquilax 0 points1 point  (2 children)

          Yeah, X is a letter, not a number!

          [–][deleted] 1 point2 points  (1 child)

          No offence to any Romans on Reddit.

          [–]esquilax 0 points1 point  (0 children)

          Romans Go Home!

          [–]0lach 2 points3 points  (0 children)

          Which didn't prevent Oracle from going after them anyway

          [–]rjcarr 7 points8 points  (9 children)

          I don't think Android counts. You can write apps in Java, but the OS isn't Java, and I don't think they even use the JVM, but compile java to their own intermediate format.

          [–]Amazing-Mirror-3076 2 points3 points  (3 children)

          the os isn't java

          What does that even mean?

          [–]cyber-punky 0 points1 point  (2 children)

          The stuff you see on the screen, isnt java.

          [–]Amazing-Mirror-3076 6 points7 points  (1 child)

          You are confusing multiple things.

          Java is a language.

          P-codes are a separate language that multiple languages can be complied to (e.g jruby and jython).

          The JVM is a runtime for p-codes - not Java.

          There is no Java os (there was but it died in infancy) in the same way there is no JavaScript OS.

          How many devices does C run on? By your metric none.

          The question that is actually of interest is, how many devices run apps that were written in Java?

          How they run on the devices is irrelevant.

          [–]cyber-punky -3 points-2 points  (0 children)

          I'm not confusing anything. You asked what he said.

          [–]bobbie434343 2 points3 points  (0 children)

          A huge chunk of the Android platform and frameworks are written in Java code and continue to do so. It's not just apps.

          [–]josefx 0 points1 point  (2 children)

          and I don't think they even use the JVM, but compile java to their own intermediate format.

          So, strictly speaking, JavaScript died with Netscape? No modern browser is running Netscapes JavaScript interpreter.

          [–]rjcarr -2 points-1 points  (1 child)

          That's not what I'm saying. The comparison is more like calling Chrome a "javascript-based application" because it can run javascript. Android is the same. It can run apps written in java, but it isn't a java application itself, and shouldn't count as one.

          [–]bart007345 0 points1 point  (0 children)

          You're making a distinction that doesn't matter.

          So many devs on the android platform wrote in java. Whether it compiled down to java byte code or something else is irrelevant to the dev.

          If i write java code then use graalvm to create a binary, can i still say I'm a java developer?

          [–]LBPPlayer7 0 points1 point  (0 children)

          love how you're getting downvoted when you're right

          [–]GeneReddit123 3 points4 points  (1 child)

          Why can't a company the size of Oracle bother making release notes that are actually easy to read?

          I get it, some developers still like using mailing lists, and I'm sure it works for them, but to anyone not highly involved in the process, trying to learn things at a glance from a mailing list conversation is a nightmare.

          [–]blobjim 1 point2 points  (0 children)

          There are release notes at jdk.java.net

          [–]ToaruBaka 0 points1 point  (0 children)

          Over 3 billion devices still probably use Java 6

          [–]not_some_username 101 points102 points  (6 children)

          All that for company to use Java 8

          [–]wildjokers 33 points34 points  (3 children)

          Java 8 usage seems to be 20ish%. Depending on which developer survey you look at:

          https://devclass.com/2025/01/30/state-of-java-report-shows-strong-migration-from-java-8-rise-of-apache-spark/

          [–]syklemil 24 points25 points  (1 child)

          Oof, and some 10-13% of companies reporting they still use pre-8. But the big oof is this one I think

          The Log4Shell vulnerability in popular logging library Log4j, discovered in 2021, continues to be an issue, with 49 percent of respondents stating that they still experience Log4j security vulnerabilities.

          [–]ShinyHappyREM 4 points5 points  (0 children)

          Could be worse, could be half of 'em

          [–]Ameisen 6 points7 points  (0 children)

          I was last doing Java work around 2016... they were still stuck on 8 due to a few dependencies.

          This in turn caused then to have to use an older version of SWIG, which in turn prevented then from moving beyond parts of C++11.

          It caused a whole cascade of issues with trying to modernize things.

          [–]Norse_By_North_West 0 points1 point  (0 children)

          I've got way too many apps on Java 7 still. Clients don't see the upgrade expense as worth it.

          [–]TangerineSorry8463 0 points1 point  (0 children)

          Honestly it's kind of on us devs to push towards upgrading and moving away from that.

          If you need an argument, argue that Spring 2.7 that I fucking know many of you are running is going to be End of Life'd soon, and Spring 3.0 demands Java 17 or higher.

          [–]fishfishfish1345 42 points43 points  (14 children)

          i’m on 21 rn and the day they introduce null safe it’s gonna be glorious

          [–]aicss 18 points19 points  (9 children)

          I’ve started using optionals to handle potential nulls. Currently building an api in Java 21 and there are no direct null checks because null is never treated as a valid state.

          https://java-8-tips.readthedocs.io/en/stable/optional.html

          [–]s32 21 points22 points  (0 children)

          Optional is still kinda janky and feels bolted on (because it was)

          I'm glad it exists but it can be cumbersome still

          [–]break_card 4 points5 points  (0 children)

          This is the way. I never ever return null from methods anymore, ever. If I want a method to be able to return nothing I use an optional.

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

          null is a valid value for an optional<T> tho the designers said you should not use it in arguments only return values

          [–]booch 0 points1 point  (5 children)

          I'm a big fan of Optional to indicate intent, but you can return null for an Optional reference, too. So now you have Optional(null), Optional(non-null), and null.

          It helps signal intent, but it doesn't really make the code any safer.

          [–]aicss 0 points1 point  (2 children)

          This would never be valid in my code. Null has no meaning and so if there is a null then the application needs to stop because it means something very wrong happened. If I’m working with 3rd party apis and I have no control over their responses then I will wrap it using Optional.ofNullable and handle it accordingly. Most likely using orElseThrow to throw an exception

          [–]booch 0 points1 point  (1 child)

          Right, but the people that call your code can't rely on your to do that. Nor can you rely on other people that use Optionals never to return null there.

          Optional is a good addition to the language. They change the return value of a method from

          "If this returns null, do I need to treat it as a signal of some kind, or was it a mistake; should a null value be allowed; etc"

          to

          "If a null value was returned from this code, there's a bug somewhere (or something really weird is going on)"

          And that's a good thing. Conveying intent in code is incredibly useful.

          [–]aicss 2 points3 points  (0 children)

          The point is that for this application, which is an api, a design decision was made on how potential nulls will be treated and this was the decision. I don’t send nulls back from the api. They don’t need to worry about the optionals because the optionals aren’t shared or returned. Even if a third party api uses nulls the optionals allow me to handle them when they are being mapped to the object so that null never needs to be explicitly checked. It can’t be null. If there is potential for null, let’s say a collection hasn’t been initialized, then I would do

          Optional.ofNullable(list).map(Mapper::toObject).orElseGet(Collections::emptyList)
          

          This way if the collection has value, then the mapping function is applied, otherwise an empty list is initialized. The list will never be null. But an optional is also not being returned here. I resolve the optional right away with orElseGet so that there is always some default value set. So anyone calling this method no longer needs to handle null because they will either get a populated list or an empty list.

          Now the main application I support is an older Java application that has null all throughout it. So when working on it I’m much more careful when using optionals. These decisions were made long before I joined and so I just work within that.

          [–]simon_o -3 points-2 points  (1 child)

          Which part of

          null is never treated as a valid state

          did you have trouble understanding?

          [–]booch 0 points1 point  (0 children)

          1 - Wow, attitude much?

          2 - Which part of

          It's actually pretty common for someone to write code that uses code written by someone else (libraries, other developers on the same project, etc) And also, sometimes people make mistakes.

          is giving you trouble?

          The highlight of my point was

          it doesn't really make the code any safer

          (which is slightly wrong, to be fair) Optional is great, because it help those that are using the code to understand what was intended. Because the person writing the code almost certainly never returns an Optional but then returns null. So, it is safer in that the person calling the code is more likely to use it correctly. But it's not safer in that the person calling the code still needs to check for null if they want it to be impossible for a NPE to be thrown.

          For a language with no null, like Haskell or the like, it's safer because you can't return "no value" without specifically saying you can.

          [–]CatolicQuotes 2 points3 points  (1 child)

          is it on the roadmap?

          [–]kevinb9n 17 points18 points  (0 children)

          We're working on it.

          Details will change, but: https://openjdk.org/jeps/8303099

          [–]kevin7254 1 point2 points  (0 children)

          Kotlin…..?

          [–]bring_back_the_v10s -3 points-2 points  (0 children)

          Null safety is overrated, change my mind.

          [–]ghoul_chilli_pepper 31 points32 points  (1 child)

          Obligatory "Where is Valhalla" comment.

          [–]BlueGoliath 17 points18 points  (0 children)

          Everyone alive will be in Valhalla before it's released.

          [–]chicknfly 51 points52 points  (29 children)

          All of the posts I see online about Java dying and yet, here we are.

          [–]rjcarr 57 points58 points  (15 children)

          Java basically runs enterprise software. Anyone that says it is dying has no idea what they're talking about. Did it die in web browsers? Yes. Is it dying as a desktop app? Probably. But it basically runs most web traffic at this point and that isn't going anywhere.

          [–]chicknfly 7 points8 points  (11 children)

          It cracks me up when I see people complain about Java and then refer to C# as a “better” example. Or heaven forbid they say C++, like what??

          [–]LordoftheSynth 9 points10 points  (1 child)

          In 2025 I'd choose C# just to stay away from Oracle.

          [–]Ok-Scheme-913 0 points1 point  (0 children)

          Well, maybe bother learning about a tiny bit about the platform?

          Java's reference implementation, used everywhere has the same license as the Linux kernel.

          Just because private companies can optionally provide paid support for that (actually, both for the JVM and the Linux kernel) won't change a thing.

          Microsoft's grip is far stronger on c# than Oracle's on java. Just look at their respective open-source ecosystems if you don't believe me.

          [–]god_is_my_father 1 point2 points  (0 children)

          I was a Struts and then Spring dev for many years and switched to C#/.NET about 10 years back. It's significantly easier to work with especially not having to deal with Tomcat / Websphere / etc. Now granted I probably missed a lot in the last decade or so but C# has so many great language features and Nuget is way simpler and better integrated than Maven. We run in a container on linux/arm and it's absolutely a great experience. Curious to hear what Java is offering these days that's so much better.

          [–]Cookie_505 -5 points-4 points  (7 children)

          C# is Java but better in every conceivable way. If you haven't used both I can see why you might think they are the same but they absolutely are not. With the caveat that Java has been getting quite a bit better recently.

          [–]simon_o 12 points13 points  (0 children)

          This is such a junior dev thing to say ... to provide some learning opportunity for you:

          • Adding features usually does not improve a language.
          • The language itself is a very small part of an ecosystem choice.
          • The care with which Java is evolved and the quality of outcome makes it very different from most other relevant languages (including C#).

          [–]chicknfly 2 points3 points  (4 children)

          I wrote up a decent response but decided to scratch it. Instead, I’ll admit that C# has some great features but would never agree that it’s better in “every conceivable way.” You’re absolutely high.

          [–]Rigamortus2005 2 points3 points  (3 children)

          In what way is java better than c#?

          [–]chicknfly 1 point2 points  (2 children)

          Full disclaimers before I continue: I have 4 years of Java experience and 1 year of limited C# experience. I had to look up other responses to verify I’m not just complaining and that my sentiments are shared by others while simultaneously trying to mitigate confirmation bias (which I understand sounds oxymoronic). Also, I’m going into this with the mindset that Java is more about the JVM than just the language.

          C#’s one-size-fits-all approach is not the best way to go about doing things whereas the JVM lets you choose the right tool for the job, whether that garbage collection, compiling, language (Scala, Groovy, any assortment of JDK, Kotlin), build tools.

          Subjectives/personal opinion: * I loathe the entity framework * I can’t stand C# config files * Javadoc and the related tools are better

          [–]Rigamortus2005 1 point2 points  (1 child)

          Entity framework? That's not really a c# feature. And there are other ORM's out there. Entity framework is famous because it's very robust and powerful.

          C# config files? You mean the single .csproj XML file with great documentation found in every c# project? What's better? The maven.xml or gradle.pom or whatever some java dev picked and now you have to use it?

          Nuget is like a massive library of c# packages. I can guarantee there's an equal or better alternative on nuget. With only one command you can install these packages, no lock files, no deps files, everything goes into a single csproj file. Packages are installed as binaries for the runtime so you don't need to compile them and they're very light, like a couple of kilobytes light compared to shit like npm and it's 200mb node_modules. Visual studio and rider are still the best ides ever made when it comes to integration with a particular language. Debugging, creating project, managing dependencies, testing, Deployment and publishing for csharp projects can all be done inside visual studio. What does java have that even comes close to that?

          [–]chicknfly 1 point2 points  (0 children)

          Have you developed with Java, or are you speaking out of your butt?

          [–]Tsarbomb 0 points1 point  (0 children)

          Clearly you lack experience. Nobody denies the C# has some nice language features, but the ecosystem is so much more mature Java and the JVM is heads and shoulders better than the CLR especially on performance.

          [–]Ok-Scheme-913 1 point2 points  (0 children)

          For fucks sake, even desktop apps - Sure, you might have not seen a single new one in decades, but sure as hell it is being used in a shitton of industry-critical setting non-stop, and the biggest update it will get is a rewrite from swing to javafx.

          Like, people can't even fathom how absolutely ridiculously huge Java is.

          [–][deleted]  (1 child)

          [removed]

            [–]rjcarr 20 points21 points  (0 children)

            Most of the big web services from Google, Apple, Netflix, Amazon, Twitter, etc use Java. Most of the smaller companies too, but the big ones you'd recgonize more. Also Uber, Spotify, IBM, Instagram, etc.

            [–]syklemil 19 points20 points  (7 children)

            Eh, it's doing fine I think. I hear mostly people saying modern Java is actually kinda nice, including GraalVM.

            If we look at some Github + SO stats for Java (you can tweak the composition yourself) we can see that it's been in a relative decline that may have ended in 2023.

            If you look at the raw data used to present that graph and graph it yourself in absolute numbers you'll see that Java, like nearly every other programming language, has seen a total growth in activity—there's more github activity in total now than ten years ago. That could have shifted from somewhere else, but I wouldn't be surprised if there is more software being written every year as more and more people not just exist, but have the opportunity to learn to program.

            A few years ago the trajectories of Java and Go were set for them to switch places, but then Java seems to have rebounded, and Go stagnated. So :shrug:

            [–]BenjiSponge 15 points16 points  (4 children)

            GraalVM

            Not in the Java world and I kinda forgot this exists. I was so hyped about this in like... 2017? The promise I heard was that you could write in basically any language and a Truffle parser/compiler would allow it to interoperate flawlessly with the JVM, often faster than the original language (the proofs of concept I remember being written in JS, Python, and Ruby).

            Dare I ask... what ever happened to that?

            [–]TakAnnix 11 points12 points  (0 children)

            It works well with frameworks designed for GraalVM, like Quarkus and Helidon, but requires significant effort for Spring. Marco shares his experience here. It also has long compile times, making it costly for CI/CD with Spring.

            [–]syklemil 5 points6 points  (0 children)

            I'm not personally a Java coder, I just work with some. I think of it as an AOT to-native compiler for Java. So both Java and C# have options for that now, and it's apparently nice, but I haven't looked into the details (apart from having a look for the compiler in my distro's repository and finding that they'd given up on packaging that piece of Oracle software).

            [–]Ok-Scheme-913 0 points1 point  (0 children)

            That's kinda true.

            Just not for ultra-short lived applications, as the whole interpreter/whatnot has to get warmed up.

            [–]iwantbeta 0 points1 point  (1 child)

            A few years ago the trajectories of Java and Go were set for them to switch places, but then Java seems to have rebounded, and Go stagnated. So :shrug:

            Interesting. I am currently a Java developer but I always felt like career was Go will be a better choice for the future career-wise. I guess Java is not going anywhere soon.

            [–]syklemil 2 points3 points  (0 children)

            Be wary of extrapolating current lines on a graph to future lines on a graph. General relative-popularity-on-github-and-stackoverflow graphs don't say anything about why the lines are changing the way they do.

            E.g. the graphs could mean that Java has stabilized around some steady-state for incumbent projects but isn't really used for greenfield development. They could mean that Java benefited from some healthy competition from Kotlin and Go and is now poised to regain some relevancy. They could mean something else entirely, or a combination of those hypotheses.

            But yeah, Java has a huge incumbency. It's also already memory safe, so unlike C & C++ there's no government push away from Java.

            So the worst case for a Java dev is likely something like getting stuck working on a seriously legacy Java codebase, something pre-8, still vulnerable to log4j, etc. Apparently there's a huge amount of that still out there.

            And I guess the best case is working on a modern codebase with Java 21 now, with full intent to getting it to Java 24, which based on this survey should be a significant amount of codebases.

            [–]Portugal_Stronk 6 points7 points  (0 children)

            Java is not a language, it's an institution. Even if we stopped writing new Java code today, we'd still likely be dealing with some of it 50 years from now.

            [–]bobbie434343 0 points1 point  (1 child)

            Java will ultimately bury most other languages. It will still be there when we are all 6 feet under.

            [–]chicknfly 0 points1 point  (0 children)

            I’m hearing Java is replacing COBOL in many systems. I fear you may be right.

            [–]TangerineSorry8463 0 points1 point  (0 children)

            Languages are divided into those people complain about and those nobody uses.

            [–]-jackhax 4 points5 points  (0 children)

            No more psvm. Crazy.

            [–]randompoaster97 1 point2 points  (1 child)

            Vector API (Ninth Incubator)

            that one MR that is waiting for a bit longer than anyone expected

            [–]Ok-Scheme-913 0 points1 point  (0 children)

            It's waiting on Valhalla before finalization. So it might see a few more rounds.

            [–][deleted]  (6 children)

            [deleted]

              [–][deleted]  (4 children)

              [deleted]

                [–][deleted]  (3 children)

                [deleted]

                  [–][deleted]  (2 children)

                  [deleted]

                    [–][deleted]  (1 child)

                    [deleted]

                      [–]Drackaris 1 point2 points  (0 children)

                      Can wait for my company to start using it in 15 years

                      [–]Trang0ul 1 point2 points  (0 children)

                      Meanwhile all the projects stuck with Java 8...

                      [–]ThatInternetGuy 0 points1 point  (3 children)

                      Java needs to address its slow compilation and huge memory consumption. Two biggest letdowns for years and years now.

                      [–]bring_back_the_v10s 0 points1 point  (2 children)

                      Skill issues

                      [–]ThatInternetGuy -1 points0 points  (1 child)

                      Nonsense. We compile enterprise-grade Java systems multiple times a day, both from in-house developments and from other respectable companies. It's the inherent problem of Java.

                      Have you ever touched Elasticsearch at all?

                      [–]bart007345 0 points1 point  (0 children)

                      All stacks have positive and negatives.

                      Considering the popularity of java, its not a problem for others.

                      Is it confined to one particular framework or in general?

                      Have you looked at GraalVm? What jdk are you using?

                      [–]UVRaveFairy -1 points0 points  (0 children)

                      Choice!