Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are both the JRE and the JDK required to run a JAR file?

Tags:

java

jar

It is possible to run a JAR file locally. The next step is to run it on a different PC.

The question is whether the JRE, the JDK or both are required to run the JAR file?

like image 761
Dhinakar Avatar asked Sep 04 '12 10:09

Dhinakar


2 Answers

The JDK contains the JRE.

Most program only need the JRE (Java Runtime Environment) but some programs need the Compiler at runtime in which case you need the JDK.

If you have the JDK, you don't need the JRE as well.

like image 117
Peter Lawrey Avatar answered Sep 25 '22 00:09

Peter Lawrey


To run a jar file you only need java.exe(windows). JDK is the development kit for Java and JRE is the runtime. JDK contains JRE.

like image 33
Akhi Avatar answered Sep 26 '22 00:09

Akhi