Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After downloading the Oracle JDK and unzipping it, I can see that there exists two "java" executables in two different directories.

Which one should be used as primary basis. Or, both are the same in two different locations?

share|improve this question
up vote 12 down vote accepted

The contents of jdk/bin/ is the Java that's included with the Java Developers Kit. The Java inside of jdk/jre/bin would be the Java Runtime Environment's Java.

If you have the JDK packaged version of Java then use the one in jdk/bin/.

But they're the same

If you look at the executables there is actually no difference in them, so it really doesn't matter.

$ pwd

$ ll jre/bin/java
-rwxr-xr-x. 1 root root 7718 Oct  8  2013 jre/bin/java
[saml@greeneggs jdk1.7.0_45]$ ls -l bin/java
-rwxr-xr-x. 1 root root 7718 Oct  8  2013 bin/java

$ cmp jre/bin/java bin/java
share|improve this answer
Okay! so I wonder why they provide two similar things. What I did was, just unpacked the jdk package. I hope the one that is inside jdk/bin works smooth on all required stages of JRE. Am I right? – Manish Shrestha Jun 9 '14 at 1:47
@ManishShrestha - given the name of the directory it's in, that would be my expectation as well. They provide the JRE by itself so you can just run apps. The JDK is to develop apps. As to why the JRE is bundled inside of JDK, you'd have to ask Oracle. – slm Jun 9 '14 at 1:48
Thanks for noticing that mate. I will try asking Oracle at some free time. :) – Manish Shrestha Jun 9 '14 at 1:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.