Install Java1.7

?
# apt-get update
# apt-get install openjdk- 7 -jdk

Switch

Change Java compiler:

?
# update-alternatives --config java
# update-alternatives --config javac

Select java 1.7:

?
There are 2 choices for the alternative javac (providing /usr/bin/javac).
 
   Selection    Path                                         Priority   Status
------------------------------------------------------------
   0            /usr/lib/jvm/java- 6 -openjdk-amd64/bin/javac   1061      auto mode
   1            /usr/lib/jvm/java- 6 -openjdk-amd64/bin/javac   1061      manual mode
* 2            /usr/lib/jvm/java- 7 -openjdk-amd64/bin/javac   1051      manual mode
 
Update also your .bashrc file with PATH variable. It must point to the new 1.7 jvm :
#echo $PATH
/usr/lib/jvm/java- 1.7 . 0 -openjdk-amd64/bin:/usr/share/ant/bin
 
And source it to take changes into account
# source .bashrc

你可能感兴趣的:(Install Java1.7)