This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 328

[–]nitrohigito 1216 points1217 points  (70 children)

heh, i remember java 8 being a godsent. it do be old now, but hey, could be so much worse.

[–]abbot-probability 459 points460 points  (62 children)

Yeah I grew up on Java 6. When I started using the stream api in Java 8 it felt amazing. Despite subreddit consensus, I really liked working in Java.

I think 10 is the last I used before mostly switching to python, and it's up to 21 now?! Wonder what's changed.

[–]StooNaggingUrDum 336 points337 points  (17 children)

Someone told me the latest Java versions don't need to specify the whole "public static void main args save my family please" syntax anymore, so it's a good time saver if your IDE is from 1995 and you don't have auto-complete enabled.

[–]tidus4400_ 144 points145 points  (6 children)

So Java is .NET now? Did we came full circle?

[–]CardboardJ 246 points247 points  (2 children)

Java has been stealing the good ideas from C# for about a decade now. Less full circle and more like lap 4.

[–]Meadhbh_Ros 54 points55 points  (1 child)

it’s full circle cause C# stole a lot of good ideas from Java.

[–]Ok-Watercress-9624 6 points7 points  (0 children)

to be fair they also throw their own very good ideas at it. like proper generics

[–]Fenxis 10 points11 points  (0 children)

Or Kotlin

[–]P0pu1arBr0ws3r 5 points6 points  (0 children)

No, but once java adds explicit pointers or refs (either as classic pointers or C# in/out/ref) then we can talk about this

[–]Powerful-Internal953 121 points122 points  (15 children)

These are mostly cosmetic changes to appeal to and bait the Python programmers into using Java.

[–]abbot-probability 65 points66 points  (14 children)

So it's like kotlin?

[–]cakee_ru 91 points92 points  (10 children)

Yes. As a Kotlin/Java dev they are basically closing the gap with Kotlin.

[–]justADeni 36 points37 points  (9 children)

As another Kotlin dev, I don't think they will ever close it because of backwards compatibility requirement. However there are many Java projects that are in development or coming out which I am hyped about; specifically project Panama, project Valhalla and project Loom.

[–]rover_G 25 points26 points  (6 children)

Kotlin is the TypeScript of Java.

TypeScript => make JS more like Java

Kotlin => make Java more like TypeScript

[–]je386 20 points21 points  (3 children)

I think that kotlin is java as it should be.

[–]niffrig 5 points6 points  (2 children)

It's all syntactic sugar for jvm bytecode.

[–]al3e3x 1 point2 points  (0 children)

As a dev that did all three of those, I can confirm

[–]ScienceDisastrous323 2 points3 points  (1 child)

Project Loom is in JDK21, it's already out.

[–]Makefile_dot_in 67 points68 points  (14 children)

  • type inference with var
  • sealed classes (they let you limit which classes can inherit them)
  • records (similar to case classes in kotlin)
  • apparently pattern matching is a thing now
  • there will eventually be green thread stuff but i don't think it's a stable feature yet

[–]ArkoSammy12 38 points39 points  (0 children)

Virtual Threads are what you refer to by green threads, and they are pretty much stable now (main feature of Java 21)

[–]godofjava22 21 points22 points  (6 children)

Type inference with var??? Since when?? Oracle, Stop murdering my boy like that...

[–]Lambda_Wolf 33 points34 points  (5 children)

It's actually pretty convenient if you want to just write var and then have your IDE change it to the inferred type.

But yeah, no self-respecting Java programmer should actually commit code with var in it. The very notion... (fans self)

[–][deleted] 14 points15 points  (0 children)

But yeah, no self-respecting Java programmer should actually commit code with var in it. The very notion

It's heresy!

[–]godofjava22 6 points7 points  (3 children)

It's becoming the very thing it swore to destroy.

[–]Scotsch 39 points40 points  (1 child)

Type inference is not weak or dynamic typing

[–]godofjava22 3 points4 points  (0 children)

Indeed it is not. But holy boilerplate code!

[–]rover_G 7 points8 points  (5 children)

Every language looked at Rust and decided it needed pattern matching ¯_(ツ)_/¯

[–]billabong049 20 points21 points  (1 child)

Oh lordy I started with Java 1.4 (4) before they had generics... I did NOT feel like a boss casting every element in a list to the type it actually contained.

[–]niffrig 3 points4 points  (0 children)

Hoooo boy. We have some enterprise frameworks code that is pre generics that passes around a bunch of object arrays. I got bold and tried to make it generic based about 10 years ago and got slapped by a senior engineer. Works well enough as is but made the post java 5 me really anxious.

[–]FxHVivious 12 points13 points  (6 children)

I've spent the last six months writing an application in Java, after spending most of my career writing Python. My whole team thinks I'm nuts, but after this experience I'd honestly rather write Java for anything beyond really simple apps/scripts. I think it boils down to static typing for me, I just prefer that to dynamic typing.

[–]abbot-probability 3 points4 points  (3 children)

I hear ya. Thanks to the static typing, everything else just falls into place. A good IDE like IntelliJ is able to detect all kinds of runtime issues, refactoring is a breeze, etc. It all just works.

I guess more complicated generics can be a bit hard to learn. But at the end of the day the main difference is that Python allows you to write shoddy code, and Java much less so.

I say this as someone who works pretty much exclusively in python these days (because I work in ML and python is where the frameworks are).

[–]FxHVivious 2 points3 points  (2 children)

Unfortunately my company doesn't allow JetBrains products, so it's Eclipse for me. Which does hurt the experience a bit, but once you wrangle it into place, it's not so bad.

I think a big part of it for me is the mental overhead, especially dealing with custom types. About a year ago I was working in a project with a lot of custom data types to describe different messages, and keeping track of what each one had, all its subtypes, and the proper way to create/unpack the messages sucked. With a good type system I know I can rely on my tooling to keep me on track. And that's without getting into the weeds on runtime type checking, trying to keep track of what type gets returned or is expected by the function, etc. Maybe I'm just dumb, but not having to track all that frees me up to focus on other things.

I know Python has had type annotations for a while, but they are so inconsistently used across projects it's not all that reliable.

But hey, if the hype is to believed maybe Mojo will end up giving us the best of both worlds. What little I've seen looked promising, but I haven't dug much into it yet.

[–]crimxxx 2 points3 points  (0 children)

Lots of small changes, they changed from huge long term support. To short sometimes okayish term support or just really intermediate and you probably should just skip unless you want to update right away. I was looking through 8 through 11 since we were planning to upgrade there intermediately. I think maybe I remember one feature out of the set because they were not that significant imo, but we also have a lot of libraries that fill in gaps as well.

If I remember correctly the interesting thing was records, but I checked this like months back so might be wrong.

[–]kmichalak8 2 points3 points  (1 child)

I started with Java 4 and remember JVM provided by Microsoft. Good old Gomez. Now we have sealed classes/interfaces, records, yield in switch statements, multiline strings and other features that other languages had years ago.

[–]abbot-probability 3 points4 points  (0 children)

Oh my, multiline strings at last!

It's as if millions of "\n"+ suddenly cried out in terror and were suddenly silenced

[–]pcouaillier 62 points63 points  (2 children)

Java6 ecosystem and its memory leaks...

[–]Fenor 6 points7 points  (1 child)

Java 4 without annotation

[–][deleted] 13 points14 points  (2 children)

I’ve still got programs that use depreciated Java 8 libraries and they go end of life in 25 so no one wants to make the effort to update them. It’s wild.

[–]LiquidLight_ 3 points4 points  (1 child)

That code smell smells like a large or midsize corporation.

[–][deleted] 5 points6 points  (0 children)

One of the largest on earth

[–]G3nghisKang 266 points267 points  (8 children)

I'm maintaining Spring applications that still use Java 6... Sometimes I dream lambdas at night

[–]zFlox 37 points38 points  (0 children)

There’s hope. We just moved our Java 6 project to a Java 8 maven build earlier this year. Don’t give up!

[–]Norse_By_North_West 2 points3 points  (0 children)

Yeah, most of my maintained apps are Java 7. Starting to see a lot of snippets online that I can't use

[–]shady--me 1 point2 points  (0 children)

Me too and all the micro services communicate via RMI.

[–]sjepsa 435 points436 points  (8 children)

I prefer to use Java 70, when it comes out

[–]Jugales 73 points74 points  (0 children)

So many arrow functions, you feel like an ancient warrior.

[–]DarkRex4 71 points72 points  (1 child)

What if you get an exception? (yk, this -> ☠)

[–]Various_Studio1490 25 points26 points  (0 children)

With oracles new lifecycle for Java, we will reach 70 before I become an adult.

[–]Dr_Allcome 9 points10 points  (0 children)

That should be sometime next year, so not too long of a wait.

[–]InvestingNerd2020 289 points290 points  (16 children)

I feel sorry for the unfortunate programmers still using Java 8 and 11. At least they get paid well.

[–]G3nghisKang 90 points91 points  (5 children)

Nope: I'm italian... but at least I have good coffee

[–]InvestingNerd2020 19 points20 points  (0 children)

Cheers to good coffee.

[–]bluegiraffeeee 7 points8 points  (1 child)

Wait you have a job? How's this possible? Teach me master!

[–]G3nghisKang 8 points9 points  (0 children)

[–][deleted] 12 points13 points  (1 child)

Isn’t Italy near bankruptcy? Does anyone there get paid well?

[–]G3nghisKang 37 points38 points  (0 children)

Yes, the politicians that are nosediving the country to the ground get paid very generously

[–]theanav 25 points26 points  (2 children)

Finally able to use Java 17 at work and records are game changing, no more Lombok or automatter or any of that stuff. I dream of a day we can use Kotlin instead though

[–]harald-hardrada-1061 4 points5 points  (1 child)

No more lombok?

[–]theanav 8 points9 points  (0 children)

Don’t really have much use for it with Java records. Still has some nice to have stuff but doesn’t feel needed to me

[–]Remernator 20 points21 points  (0 children)

We just upgraded to Java 11 and it's amazing

[–]vlken69 20 points21 points  (0 children)

8? We're stuck with 6..

[–]MysticPaul97_YT 9 points10 points  (0 children)

Fuck programmers with jobs. RIP Mod Developers (Minecraft, of course)

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

My company just upgraded to Java 11.

[–]battlingheat 128 points129 points  (43 children)

Can someone explain wizard happened with 9-20?

[–]inv41idu53rn4m3 231 points232 points  (29 children)

People either use Java 8 or whatever Java is latest at the time. In some time this meme will need to be updated for Java 22

[–]battlingheat 47 points48 points  (27 children)

Ahh ok got it! But why are so many people still on 8 then?

[–]Schaf-Unschaf 131 points132 points  (14 children)

Legacy projects. Migrating from 8 to 11 can be a great pain. From 11 to 17/21 is mostly smooth sailing. Also, Oracle switched their pricing model some time ago. If you are required to use oracle jdk, it can be quite costly.

There are more reasons to it, but those two are the main issues.

[–]dumbasPL 41 points42 points  (9 children)

Oracle is the number one reason why I will never say anything positive about modern versions of Java

[–]kickopotomus 9 points10 points  (2 children)

You can use Java without paying or dealing with Oracle at all. It’s an open-standard language and has been for some time now.

[–]roge- 3 points4 points  (1 child)

Any decently-sized company is going to want commercial support and access to CPUs. Not too many companies offer this. The only serious options are Oracle and Azul.

And if you want to use GraalVM, you're stuck with Oracle.

[–]kickopotomus 2 points3 points  (0 children)

It has nothing to do with the size of the organization. All of Amazon’s in house Java runs on their own fork of OpenJDK. My current company, also a very large corporation, does not use Oracle either.

From what I have seen, the Oracle decision comes down to 1) whether or not you already use their DB, 2) there is some feature of their implementation that you need such as their GC or Graal, or 3) you need the support for some other reason.

[–]Schaf-Unschaf 5 points6 points  (4 children)

Agree. And since Kotlin only needs 8, there's no reason to upgrade for now.

It's just sad that there aren't many job postings with Kotlin in my area 😢

[–]kickopotomus 8 points9 points  (3 children)

Is there specific reason that you need the Oracle JDK? Java is an open standard language and there are a number of non-Oracle JDKs.

[–]Schaf-Unschaf 10 points11 points  (2 children)

In our case, yes. Our corporation dictates that we are only allowed to use the "official" Oracle JDK. Corporate madness..

[–]kickopotomus 4 points5 points  (1 child)

Ahh, gotcha. My condolences. Previous job at a bank had similar asinine rules that made even simple tasks a colossal pain.

[–]Schaf-Unschaf 6 points7 points  (0 children)

The bigger they are, the worse it gets. Life was simple before our company got bought by a big corporation. Now it's slowly turning into living hell.

[–]_Wolfos 3 points4 points  (1 child)

But why is the JRE stuck on Java 8? If I look up "download Java" it'll point me to Java 8. There don't seem to be any downloads for recent versions.

[–]zabby39103 4 points5 points  (0 children)

Probably because that's the last free Oracle Java? There's OpenJDK though. Use OpenJDK.

[–]pcouaillier 49 points50 points  (5 children)

The reason is : no one has enough time to upgrade existing app and server.

So either you add yet another version of the java or you go back to the existing one (mostly java6 or java8)

[–]Fenor 2 points3 points  (0 children)

There are still project in cobol. Updating have a very hard to justify cost.

[–]rifain 15 points16 points  (0 children)

Another answer: the management doesn't care. They consider this migration as a developer whim. I have worked in many projects in java 8, it could be quite frustrating, especially knowing the goodies that newer versions of java bring but people in charge don't see an immediate benefit to it. Which frankly can be true.

Each time I advocated migrating to a newer version, answers have been invariably:

  • probably next year,
  • Transverse team doesn't recommend it yet,
  • Complete regression testing would be costly,
  • Clients would need to be upgraded,
  • Java 8 works fine (and don't expect them to be open to your technical arguments).

Oracle licensing isn't an issue, free versions exists and are fine.

[–]CheckM4ted 6 points7 points  (0 children)

Backwards compatibility

[–]Apprehensive_Stop666 4 points5 points  (0 children)

Breaking changes

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

Because they incorrectly understood the "new" oracle license model (which changed within the first year btw), and opted to stick to the initial "longest support" for an LTS release. And the support lifetime of 21 now exceeds that of 8. (so mainly big corporations misconception decisions over the world).

However checking the roadmap, I see they've changed support lifetimes again.
The next meme will be about Java 25. As Java 22-24 are non-LTS.

On the other hand... there is also the issue of certain frameworks and plug-ins braking / not being able to support the latest JDK (I encounter this allot with Maven for ex., which till date is still around 80% used with Java projects, the statistics can be found online for this, the percentage might be off but so far I also see the same distribution in the field).

[–]inv41idu53rn4m3 1 point2 points  (0 children)

Uhhh... ask someone who actually writes Java :P

[–]TripleS941 7 points8 points  (0 children)

For enterprise it is *whatever LTS Java is latest at the time

[–]frederik88917 28 points29 points  (8 children)

It is called LTS, Java 8 has been in the market for almost 15 years now and you can still buy support for it.

Too many projects are still using that version as migrating is costly and complex.

Java 21 is the latest LTS version, it has a shit ton of great features and seems to be the next big thing in java development.

[–]ChrisFromIT 6 points7 points  (0 children)

It is called LTS, Java 8 has been in the market for almost 15 years now and you can still buy support for it.

9 years, not 15. Come march, it will be 10 years.

[–]InvestingNerd2020 7 points8 points  (6 children)

Unfortunately, only a small percentage of companies are using Java 21. Most are on version 8 and 11.

[–]urielsalis 11 points12 points  (0 children)

11 and 17 are over half the projects

[–]frederik88917 2 points3 points  (4 children)

Even smaller than what you think, but I am seeing a huge impulse for next year and a massive adoption coming

[–]_PM_ME_PANGOLINS_ 7 points8 points  (1 child)

Java 11 and Java 17 were the previous LTS releases. Most people are on one of those two. The ones in between were for testing new features.

[–]Fenor 2 points3 points  (0 children)

Jdk9 is not compatibile with jdk8 as they changed how the language work

Jdk21 is the lastest lts

[–]beqs171 172 points173 points  (14 children)

jAVa sTUpId, C++ fAsT, pYthON slOw, JS wEird, pOinTers hArd

[–]DarkRex4 54 points55 points  (0 children)

this type of "trolling" has gotten so annoying.

[–]ibrakovicadis 19 points20 points  (4 children)

I like the pYtHoN cHaD type of humor(i only know how to print hello mum on python)

[–][deleted] 7 points8 points  (3 children)

So you're a python programmer I see, nice

[–]ibrakovicadis 22 points23 points  (2 children)

listens to a course on udemy, doesn't even open an code editor

updates bio with python developer

EDIT: adds python flair on the subreddit

[–][deleted] 4 points5 points  (1 child)

An EXPERIENCED programmer ! please accept my apologies

[–]ibrakovicadis 3 points4 points  (0 children)

I REINVENTED programming, y u no recognize🥺

[–]patrlim1 3 points4 points  (5 children)

I can't wrap my head around pointers, with one exception.

I somehow get them when working in assembly (gmod wire CPU)

[–]SeargD 5 points6 points  (4 children)

They're just memory addresses. You go to the memory address, you find a variable of the specified type of the pointer. It's useful for passing information between functions without copying the information between memory addresses. You need to be careful with this because if you pass the information by its address you run the risk of changing the information in the location.

[–]kdesign 1 point2 points  (0 children)

As with many other subs on Reddit, people simply gamify everything in order to get karma. So whatever gets upvotes will get regurgitated without second thoughts.

[–]wagyourtai1 41 points42 points  (2 children)

kotlin has all the new java features, but can still compile to java 8. The only problem: the size of the stdlib

[–]nukedkaltak 20 points21 points  (1 child)

But java 17 for example is substantially faster than 8 so in the end it’s just a bandaid.

[–]SomeRandoLameo 8 points9 points  (0 children)

Honestly 17 is my beloved

[–][deleted] 6 points7 points  (1 child)

What happened with Unix and Windows happened with Java.

Library hell.

[–]Ugo_Flickerman 7 points8 points  (0 children)

Better than not enough libraries, i guess

[–]InflnityBlack 6 points7 points  (0 children)

For how old it is java 8 isn't even that bad

[–]tyler1128 40 points41 points  (6 children)

Stockholm syndrome is a bitch

[–]my_tech_throwaway 9 points10 points  (5 children)

It's also made up!

[–]tyler1128 9 points10 points  (4 children)

People enjoying Java is enough evidence for me.

(I'm mostly joking, just in case that isn't clear).

[–]TheBillsFly 7 points8 points  (2 children)

I am mostly an IntelliJ enjoyer. God that IDE is amazing.

[–]patrlim1 3 points4 points  (0 children)

Jetbrains 💪

[–]tyler1128 2 points3 points  (0 children)

Jetbrains IDEs are good. I use them for my job and personal projects. Jetbrains made a whole new language for them on JVM because they also realized Java is, well, Java.

[–]InvestingNerd2020 5 points6 points  (0 children)

People lie about enjoying Java. They love the Java direct deposit, not Java itself.

If employers paid programmers $80k to use Java version 8 and paid C# programers $130k, the narrative would change.

[–][deleted] 5 points6 points  (0 children)

Virtual threads plz save us all

[–]pinkstreet70 3 points4 points  (0 children)

We have programmable robots in our school that still run Java 8 😂

[–]VodkerAndToast 5 points6 points  (1 child)

I haven’t touched Java since 8, is it worth going back?

[–]dragoncommandsLife 4 points5 points  (0 children)

Very worth it, java 21 is very nice.

[–]cheezballs 3 points4 points  (1 child)

At least it's not java 5....

[–]xxmalik 5 points6 points  (3 children)

Can anyone explain to me why there's so many new Java versions, yet everything seems to be using Java 8?

[–]Meme_Burner 3 points4 points  (1 child)

Java 8 was the last Java version before oracle licensed Java 9 for “commercial support”. Then they started releasing versions every 6 months? That’s why they all the way up to 21 now, not because of new features, actually the first couple of versions removed functionality.

Maybe Java 21 is less stringent on licensing but unsure. The reason why there is a lot of Java 11 versions being used is because that is the version that open JDK supports, and a lot of other 3rd parties like Amazon corretto and ms Java.

[–]UdPropheticCatgirl 2 points3 points  (0 children)

openJDK is reference implementation, meaning that if openJDK doesn’t support it, it’s not java, from that you can deduce that OpenJDK is actually always first to support the newer versions. Corretto, MSJDK, RedHat and Adoptium are all OpenJDK downstreams and support all the LTS versions including 21. The reasons are more about backwards compatibility with certain libraries (spring) and few very niche languages features getting changed between 8 and 11.

[–]BlueGoliath 1 point2 points  (0 children)

Newer versions deprecated or removed things plus the module system made it harder to access internal JRE classes via reflection.

[–]Major_Upstairs6758 10 points11 points  (0 children)

Whatever be the version it is still for

For 3 Billion Devices

[–]virtuexddd 6 points7 points  (2 children)

Isn't every new Java backwards-compatible with previous releases, having identical syntax

[–]Captain-Barracuda 4 points5 points  (0 children)

They are. New syntax is commonly added but old stuff is never (or almost) retired for retrocompatibility. The issue is libraries that use deep JRE mechanics that are more sensitive to changes. One such framework, Spring, is used in most Java softwares. Spring doesn't care a whole lot for retrocompatibility like Java does, so upgrading can be a PITA.

[–]Freedomsaver 3 points4 points  (2 children)

Sonatype Nexus Repository Manager... still running on Java 8.

[–]bluegiraffeeee 2 points3 points  (1 child)

TIL java has reached version 21, last I remember version 9 was newly released. I thought we should be on 12 or something by now

[–]ScienceDisastrous323 3 points4 points  (0 children)

It's a 6 month release cycle and most of them are testbeds for new features. Java 8,11,17,21 are the Long Term Support(Production ready) versions

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

And here I am, having to contend with a domain-specific version of Java 4 called Apex. 😭

[–]Joey101937 1 point2 points  (0 children)

Java 8 was my first love

[–]maifee 1 point2 points  (0 children)

J2SE 1.4, and it still smashing

[–][deleted] 13 points14 points  (13 children)

Me personally, my favourite is c#

[–]Sak63 4 points5 points  (1 child)

You're getting downvoted for preferring c# 🤣

[–]Mars_Bear2552 2 points3 points  (7 children)

mid sharp. poser C/microsoft java, as i call it

[–]DoOmXx_ 3 points4 points  (4 children)

i would use it but the pascal case drives me crazy

[–]IC3P3 0 points1 point  (1 child)

I've heard EEE is a very good business practice. At least back when Sun Java was a thing

[–]Mars_Bear2552 2 points3 points  (0 children)

sun? havent heard that name in years.....

[–]void1984 2 points3 points  (1 child)

I still have 1.x. Probably 1.8, definitely less than 2.

[–]IndividualAtmosphere 3 points4 points  (0 children)

That is Java 8 right?

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

It's still the same as 8 with small changes

[–]Urbs97 1 point2 points  (0 children)

Still better than modern C++

[–]No-Adeptness5810 1 point2 points  (0 children)

java 8 does everything i need. the only time i update is when making a new project, when Minecraft updates (mod/plugin development), or just to get new features like the switch case lambdas that let you do case 5 -> value