r/javahelp • • Apr 14 '24

How do I install Java?

I'm sorry for this stupid question, but I'm really struggling here. I'm using Linux, and I don't know what I should install, there are so many packages. Should I install java, jdk, jvm, jre??? Maybe Openjdk? Java 8, 17 or 20?
For context, I'm coming from Python and a little bit of C, and installing python is easy you just install the python interpreter and run "python", or with C you just install GCC and glibc (if you don't have it for some reason). But for Java there are so many options and so many packages I just want to compile and run Java files, with the Java standard library, help please?

2 Upvotes

27 comments sorted by

View all comments

0

u/[deleted] Apr 14 '24

[deleted]

5

u/OffbeatDrizzle Apr 14 '24

why are we recommending oracle's JDK's these days? gross... use something open source like adoptium https://adoptium.net/en-GB/temurin/releases/

0

u/[deleted] Apr 15 '24

[deleted]

1

u/OffbeatDrizzle Apr 15 '24

6 years ago oracle changed the licensing such that you have to pay them if you use it in a production environment. the open jdk builds ARE the reference implentation, and so AdoptOpenJDK started giving out builds but it has since moved over to Adoptium

there is basically no difference between openjdk and oracle builds, they're the same thing except for the licensing around them, hence why you shouldn't be using the oracle JDK

1

u/[deleted] Apr 15 '24

It is also so expensive

1

u/wildjokers Apr 15 '24

6 years ago oracle changed the licensing such that you have to pay them if you use it in a production environment.

FWIW, the license was changed in Java 17 so Oracle JDK can be used in production for free. Although there is still no need to do so unless you are paying Oracle for support.

the open jdk builds ARE the reference implentation

OpenJDK is Oracle's implementation of the Java SE specification. (which I think is what you were getting at, but just wanted to specify that OpenJDK is Oracle's...I am not personally aware of any other implementation of the Java SE specification)

0

u/[deleted] Apr 14 '24

[deleted]

1

u/OffbeatDrizzle Apr 14 '24

what does that even mean? they're builds of the same JDK, except that you can use it in production free of charge without having to pay oracle. there's literally 0 difference in the code - it is NOT a different jvm