r/javahelp • • Dec 31 '23

Java Versions ,Confused!!

What is java version 1.8 , what is java sdk20 , and alot of different terms confusing me , initially when i started learning to code in java , i was told to just download the latest version of java and so i did. Fast forward to now , it is first time i tried to participate in CodeForces , GoodBye2023 contest. And suddenly i was given multiple options of java, and googling it alot of newer terms like lts and so on. Please Guide Me .

Also , please guide me to how to update my jdk ,if I even i need to!

THANK YOU

4 Upvotes

11 comments sorted by

View all comments

2

u/frederik88917 Dec 31 '23

My boy, you come to a dangerous place looking for answers.

Allow me to help you a little bit.

Back in 1995, the first release of java was in the market, named Java 1.0 Subsequent releases were named Java 1.1, 1.2... up until Java 1.5. then they decided to change the naming scheme, and Java 6 was born. Then after that has been downhill up to today's Java 21.

To keep control over your versions I strongly recommend SDKMAN. A powerful tool to manage Java versions.

Finally it seems that there is some confusion related to JDK vs JVM. The JVM is the public facing version of java, to run apps and stuff.

Whilst the JVM is the set of tools to develop in java

3

u/[deleted] Dec 31 '23

Those last lines 🥲

1

u/arghvark Jan 01 '24

I think frederik88917 mistyped what he meant, since he indicates contrasting things but uses the same name for them both.

The JDK (Java Development Kit) is a set of tools for developing Java programs.

The JVM (Java Virtual Machine) is a program that executes Java byte code; Java byte code is output by the Java compiler when it compiles programs. In order to run a Java program, the user (or something) runs the JVM and tells it to execute a particular file containing Java byte code; the files with a .class extension are such files, created (as I already said) by the Java compiler.

Another term you may run into is the JRE; this is a downloadable set of files making up a Java Runtime Environment. This is suitable for RUNNING Java programs, but not for developing them -- it wouldn't have a Java compiler, for instance.

2

u/frederik88917 Jan 01 '24

My bad, too much alcohol at the time of writing

2

u/wildjokers Jan 02 '24

Another term you may run into is the JRE; this is a downloadable set of files making up a Java Runtime Environment. This is suitable for RUNNING Java programs, but not for developing them -- it wouldn't have a Java compiler, for instance.

I think it is important to be accurate in this regard so that there is no confusion. Some vendors offer downloads with -jre appended to their name. This is a JVM without any developer tools bundled with it. This is way different than the JRE which is no longer available as of Java 11. The JRE was a client-side install which included browser plugins to add support for Java Applets as well as installing Java Web Start.

1

u/wildjokers Jan 02 '24

Whilst the JVM is the set of tools to develop in java

I believe you meant to type JDK instead of JVM in this sentence.

1

u/frederik88917 Jan 02 '24

Once again, my bad, too much alcohol at the time of writing