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

3

u/euphon99 Apr 14 '24

You need to install the Java Development Kit (JDK), this includes the Java Virtual Machine (JVM) and Java Runtime Environment (JRE). Download here: https://www.oracle.com/uk/java/technologies/downloads/

Then you can use an integrated development environment (IDE) to create, compile and run Java classes. In my experience IntelliJ is the best IDE, download here: https://www.jetbrains.com/idea/download/

Good luck!

0

u/[deleted] Apr 14 '24

[deleted]

1

u/euphon99 Apr 15 '24

Didn't know that, thanks!

2

u/wildjokers Apr 15 '24

Note that as of Java 11 the JRE no longer exists. The JRE was a client side install that added support for Applets and Java Web Start.

1

u/euphon99 Apr 15 '24

Didn't realize this, thanks for the comment!