How to Install JDK7 in Linux

You can install the JDk7 in Linux step by step as follows:


1. Download compressed file


the 32-bit or 64-bit Linux  "Compressed binary file", It has a ".tar.gz"file extention. for example, "jdk-7u9-linux-x64.tar.gz " which I installed.  "[Java-version]-x64.tar.gz"  indicated that it is for 64bit.


2. Uncompressed it


tar -xvf jdk-7u9-linux-x64.tar.gz 


3. Move the uncompressed file to /usr/bin/ directory


sudo mv ./jdk-7u9-linux-x64.tar.gz /usr/lib/jvm/jdk1.7.0

4.Now run

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

sudo update-alternatives --config java

sudo update-alternatives --config javac
sudo update-alternatives --config javaws


5.Enable mozilla firefox plugin

if in the mozilla dictory, there is not a file called plugins. you should make a one.

mkdir ~/.mozilla/plugins

and then

ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
sudo /etc/init.d/apparmor restart


6. the command that see the version fo Java is as follow:

java -version


How Install JDK7 Linux
您的回应...

相关话题

查看全部

也许你感兴趣

换一批

热门标签

更多