E
E
Ertdf2018-11-06 22:34:42
Java
Ertdf, 2018-11-06 22:34:42

Do I need to install the pubic JRE if the private JRE that comes with jDK 11 is installed?

Good day to all! Recently I started to learn Java and the following problem arose: I demolished all the old versions of Java and installed the latest version of JDK 11. But it's bad luck if I want to run a ready-made Java application (which was compiled in IDEA) from the console it gives an error:

Error: opening registry key 'Software\JavaSoft\Java Runtime Environment'
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.

Having rummaged through the Internet, I realized that there are public JRE and private JRE. That the former are intended for the operation of the JDK itself, and the latter for the operation and launch of their applications. So is it necessary to install public JRE? But if so, then, as far as I understand, the latest "public" JRE exists for earlier JSEs. And in earlier JREs, applications written using JDK 11 do not run. (Previously, there was a public JRE for JSE 8 by default and when trying to run applications compiled in IDEA from the console, an error was generated that a later version of JRE was needed, which is logical) .

So the question is, is it possible to run applications written using JDK 11 from the console by simply writing:
java <название_приложения>
Is it possible to use the private JRE available in JDK 11 for this? If not, how can older public JREs like JRE 8 be made to run?
Help a newbie! Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alfss, 2018-11-07
@alfss

Read what is jdk, jre.
Build systems maven, gradle.
Use java se 8.
Run built jar from console java -jar youapp.jar
Read about compatibility between java versions.
There is no difference between private and public jre, just one comes with jdk, and the other is a cropped version of the same jdk, without the possibility of assembly, only launch. Write the full path to the jre you need `/path/to/java - jar.. '

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question