Search This Blog

Friday, May 11, 2012

Installing JDK 1.6 on Ubuntu


  • Installing Sun JDK 1.6: You can download oab-java6 zip file from this URL , then you will need to extract this zip file and open the terminal (pressing ctrl+alt+t) to run ./oab-java6.sh. You must be run this command as sudo (using a root account).

Installing JDK 1.6 on Ubuntu

 This script is doing the following:
The basic execution steps are:
  • Remove, my now disabled, Java PPA 'ppa:flexiondotorg/java'.
  • Install the tools required to build the Java packages.
  • Create download cache in /var/local/oab/pkg.
  • Download the i586 and x64 Java install binaries from Oracle. Yes, both are required.
  • Clone the build scripts from https://github.com/rraptorr/sun-java6
  • Build the Java packages applicable to your system.
  • Create local apt repository in /var/local/oab/deb for the newly built Java Packages.
  • Create a GnuPG signing key in /var/local/oab/gpg if none exists.
  • Sign the local apt repository using the local GnuPG signing key.
What if this script didn't go well with you ? on of the problems you may face is throwing an error saying "Error: Package sun-java6-jdk is not available, but is referred to by another package"

You can run the following in the terminal :

sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jdk

By previous steps, it is expected that you have installed JDK 1.6 on your systems. The only remaining step is to set the class path of Java by the following commands:

export JAVA_HOME=/usr/lib/jvm/java-6-sun

To ensure that the new Java Home is set correctly, you can print (echo) the JAVA_HOME environment variable by the following command:

echo $JAVA_HOME

2 comments:

  1. Getting error: hadoop command not found even if jps command shows all service running
    hduser@BIFACT-1:~/hadoop/bin$ hadoop jar ../hadoop-examples-1.2.1.jar pi
    hadoop: command not found
    hduser@BIFACT-1:~/hadoop/bin$ jps
    19617 JobTracker
    19482 DataNode
    19220 NameNode
    19987 Jps
    19866 TaskTracker
    hduser@BIFACT-1:~/hadoop/bin$

    ReplyDelete
  2. Use the command sudo HostMyCode apt install openjdk-6-jdk to install JDK 1.6 on Ubuntu.






    ReplyDelete