1

I have just updated my JDK to version 12.0.1. Compiling works like a charm, but I cannot run the files anymore.

However, I couldn't find a fitting JRE (like JRE 12 or so). As it seems, there is no JRE anymore, but everything is merged into the Java SE. For that thing, I cannot find a download too; it always just gives me the JDK I already have.

So, how can I get the JDK-12-compiled files to run? Where can I get the JRE 12 or however what it's called now?

The JDK seems to be enough when I work within IntelliJ, but I cannot run the java command inside the cmd.

Thanks in advance!

2 Answers 2

0

The JDK seems to be enough when I work within IntelliJ, but I cannot run the java command inside the cmd.

In my experience IntelliJ uses it's own implementation to determine the location of the Java bin location. This way you can have multiple instances of Java Runtime Environment installed and point to the version the project should use.

The only way you would be able to compile software is if you had the java runtime environment installed. The Java Runtime Environment (JRE) has always been included in the Java Development Kit (JDK).

Where can I get the JRE 12 or however what it's called now?

You already have the Java Runtime Environment installed. Everything that you needed was installed by the Java SE Development Kit 12.0.1.

I couldn't find a fitting JRE (like JRE 12 or so).

The Oracle JDK license changed with the release of Java 10. The equivalent version of Java SE Runtime Environment 8 is the Java SE Development Kit 12.0.1.

The only reason you cannot run the java command inside a command prompt is due to a system variable issue. You likely are not pointing to the correct location within the JDK12 installation directory.

0
0

In the JDK 12 Readme you will find the following:

Contents of the JDK

...

Executables

(In the bin/ subdirectory) An implementation of the Java Runtime Environment (JRE). The JRE includes a Java Virtual Machine (JVM™), class libraries, and other files that support the execution of programs written in the Java programming language. This directory also includes tools and utilities that will help you develop, execute, debug, and document programs written in the Java programming language. For further information, see the tools documentation at https://docs.oracle.com/en/java/javase/12/tools/tools-and-command-reference.html

This means that once you download the JDK, you can have the JAVA_HOME environment variable point to the JDK folder, like this:

JAVA_HOME=\path\to\jdk-12

(Speaking about a Windows machine) You also need to put the \bin folder of the JDK as the first folder in the Path environment variable, like this:

Path=%JAVA_HOME%\bin;other;folders;here

Now you should be able to run java.exe from the cmd.

The info on how to set the environment variables I took from this guide.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .