Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

1 Answer 1

up vote 11 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
/usr/java/jdk1.7.0_45

$ 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 at 1:47
1  
@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 at 1:48
1  
Thanks for noticing that mate. I will try asking Oracle at some free time. :) –  Manish Shrestha Jun 9 at 1:50

Your Answer

 
discard

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.