Wednesday, August 15, 2012

Setting path for java variable in terminal environment

installing and downloading sun java package
1. download the package jdk-6u29-linux-i586.bin
2. type the following to extract

        sh jdk-6u29-linux-i586.bin

   which will extract it in the current directory
3. Move extracted folder to the location /usr/lib/jvm

        sudo mv jdk1.7.0_ /usr/lib/jvm/

4.Inform Linux/ubuntu that new java source is available by typing (instead of editing in .bashrc file)

        sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_/bin/javac 1

  this installs the javac compiler and for the java interpreter type the below one

        sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_/bin/java 1

5. now after installing configures required for it type

        sudo update-alternatives --config javac

        sudo update-alternatives --config java

No comments:

Post a Comment