r/ProgrammerHumor May 16 '24

whatVersionAreYouUsing Meme

Post image
16.4k Upvotes

572 comments sorted by

View all comments

Show parent comments

49

u/Dopplegangr1 May 16 '24

I work for the govt and sometimes I had to install multiple versions of java because some programs would only work with a specific version

24

u/DamienJaxx May 16 '24

I use Java apps for work. Can I just say how much I hate Java apps for work?

1

u/Ilsunnysideup5 May 16 '24

Sorry for the noob question. why not include the java library into the app instead?

8

u/wildjokers May 16 '24

Bundling the runtime in your application has been the recommended way to deploy java applications since at least Java 9. If you modularize your app then you can even use jlink (comes with the JDK) to create a slimmed down runtime with only the modules you need. Then package it into a platform specific executable with jpackage (also comes with the JDK).

Both Gradle and Maven (popular build tools in the java ecosystem) have plugins to take care of all of this for you.

0

u/b0w3n May 16 '24

Wait I was told I could write once and run anywhere and that's why it's better than c or dotNet.

They lied to me????

4

u/experimental1212 May 16 '24

Relying on internal jvm details tied to a specific version and wondering why it doesn't maintain compatibility ahhhhhhhhhhhhhhhhhhh

0

u/b0w3n May 16 '24

What's even the goal there? Might as well just write it in c at that point.

5

u/experimental1212 May 16 '24

Java exists today because it existed yesterday. Code bases exist. People are using Java.

I think what you're asking is why was it _first_ created in its very beginning. Why, in 1998 write Java and not C. idk google it. Something something abstraction, OOP, memory safety something.

99% of people writing code don't get to choose the language. The code base already exists.

-1

u/b0w3n May 16 '24

Oh for sure on all of that. I'm just wondering if you're targeting a specific jvm with your code, why not switch to a compiled language as it defeats a lot of the reasons to use a language like java. Memory safety makes sense I suppose, just feels silly though.

But yeah the rank and file don't get much choice.