Download Java 7 from Oracle.
Put it in /usr/lib/jvm.
Extract and install it
tar -zxvf jdk-7u40-linux-x64.gzRename the folder from jdk1.7.0_40 to jdk1.7.0
You should now have jdk1.7.0 inside /usr/lib/jvm
Set java, javac.
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
Correct the permissions.
sudo chmod a+x /usr/bin/java
sudo chmod a+x /usr/bin/javac
sudo chown -R root:root /usr/lib/jvm/jdk1.7.0
If you have more than one version of java, you can always switch them using
sudo update-alternatives --config java
Check your java version.
java -version
No comments:
Post a Comment