2

I just installed Fedora 19 and managed to get FedoraUtils installed. So I chose java oracle. after installation I could see in the FedoraUtils list that oracle java (installed) but I can't see the Oracle Java anywhere.

As an Ubuntu user I would run the update-java-alternatives -l command but it didn't work. Below is the output of alternatives --list:

mta                      auto    /usr/sbin/sendmail.sendmail
javac                    auto    /usr/java/latest/bin/javac
jre_1.7.0_openjdk        auto    /usr/lib/jvm/jre-1.7.0-openjdk-1.7.0.60-2.4.2.0.fc19.x86_64
mkisofs                  auto    /usr/bin/genisoimage
ld                       auto    /usr/bin/ld.bfd
java                     auto    /usr/java/latest/bin/java
jre_1.7.0                manual  /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.2.0.fc19.x86_64/jre
pax                      auto    /usr/bin/spax
print                    auto    /usr/bin/lpr.cups
jre_openjdk              manual  /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.2.0.fc19.x86_64/jre
libnssckbi.so.x86_64     auto    /usr/lib64/pkcs11/p11-kit-trust.so
libjavaplugin.so.x86_64  auto    /usr/java/default/jre/lib/amd64/libnpjp2.so
fakeroot                 auto    /usr/bin/fakeroot-tcp
unrar                    auto    /usr/bin/unrar-nonfree
xinputrc                 auto    /etc/X11/xinit/xinput.d/ibus.conf
cifs-idmap-plugin        auto    /usr/lib64/cifs-utils/idmapwb.so

I don't remember typing openJDK but apparently it's installed. I would really like to find out where's oracle-java. I don't mind having the 2. When I check for the version in order to get the default java:

[joseph@localhost ~]$ java -version
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)
  • Question 1 : Where is oracle java installed
  • Question 2 : How to check default java in fedora
  • Question 3 :I will like to set up system environment for JAVA_HOME, how does it work in /etc/environment?

EDIT all the commands suggested by @sim my screen looks this way: fedoraulits additional software screen

#type java 
java is /bin/java

#rpm -aq | grep jdk
jdk-1.7.0_40-fcs.x86_64  // is this one oracle java?
java-1.7.0-openjdk-1.7.0.60-2.4.2.0.fc19.x86_64


#alternatives --display java |grep best
Current `best' version is /usr/java/latest/bin/java.

#type -a /usr/java/default/bin/java
/usr/java/default/bin/java is /usr/java/default/bin/java

#rpm -qf /usr/java/default/bin/java
jdk-1.7.0_40-fcs.x86_64 // I assume this one is oracle java. 

Is /usr/java/default/bin/java the home for oracle java?

  • 1
    Yes, jdk-1.7.0_40-fcs.x86_64 is the oracle java. – slm Sep 15 '13 at 12:44
  • Things are a bit different In fedora. Apparently /etc/environment is empty is that normal ?I hesitated about putting the have home in there – black sensei Sep 15 '13 at 14:39
  • I'm running Fedora. Do you mean coming from the Debian/Ubuntu side? – slm Sep 15 '13 at 14:40
  • Exactly am more used to Debian/Ubuntu family – black sensei Sep 15 '13 at 14:50
5

locating java

Try using this command:

$ type java

to find out where Oracle Java is installed. Also open JDK is the opensource project's version of Java, you have to download and install Oracle Java from the Java website. It comes as an RPM you can install.

Java package

If you've used FedoraUtils to automatically install packages then these should be showing up when you query the RPM database:

$ rpm -aq | grep jdk
java-1.6.0-openjdk-javadoc-1.6.0.0-55.1.9.10.fc14.x86_64
jdk-1.6.0_26-fcs.x86_64
java-1.6.0-openjdk-devel-1.6.0.0-55.1.9.10.fc14.x86_64
java-1.6.0-openjdk-plugin-1.6.0.0-55.1.9.10.fc14.x86_64
java-1.6.0-openjdk-1.6.0.0-55.1.9.10.fc14.x86_64

Backtracking with alternatives

I typically do it like this.

  1. locate within alternatives

    $ alternatives --display java |grep best
    Current `best' version is /usr/java/default/bin/java.
    
  2. confirm with type

    $ type -a /usr/java/default/bin/java
    /usr/java/default/bin/java is /usr/java/default/bin/java
    
  3. query RPM

    $ rpm -qf /usr/java/default/bin/java
    jdk-1.6.0_26-fcs.x86_64
    

NOTE: The jdk... packages are what Oracle's label's their Java packages as. Go figure, it stands for Java Development Kit. There is also a JRE package you'll see from time to time, that's the Java Runtime Environment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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