Wednesday, 21 August 2013

Set JDK in Ubuntu (LINUX)

Run the following commands in your terminal if you have the tar.gz

1. tar -xvf jdk-7u21-linux-i586.tar.gz

2. sudo mv ./jdk1.7.0_21 /usr/lib/jvm/jdk1.7.0_21

3. sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_21/bin/java" 1

4. sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0_21/bin/javac" 1

5. sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0_21/bin/javaws" 1

6. sudo chmod a+x /usr/bin/java

7. sudo chmod a+x /usr/bin/javac

8. sudo chmod a+x /usr/bin/javaws

9. sudo chown -R root:root /usr/lib/jvm/jdk1.7.0_21

10.sudo update-alternatives --config java

11.export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_21/

12.export PATH=$PATH:/usr/lib/jvm/jdk1.7.0_21/bin

No comments:

Post a Comment