Set default JDK under CentOS
Recently in the Linux, with the Yum source installed Opnjdk-devel version, with the command Ll/etc/alternatives/java view, found to point to the JRE directory, rather than JDK, this setting points to the JDK directory.
Set default JDK under CentOS
To execute a command:
[Root@exkpicture ~]# Alternatives–install/usr/bin/java Java/usr/java/jdk1.7.0/bin/java 2
Note: Alternatives's grammar look here
To execute a command:
[Root@exkpicture ~]# Alternatives--config java
Select the default JDK, where "+" is the default JDK
*+ 1/usr/lib/jvm/jre-1.6.0-openjdk/bin/java
2/usr/java/jdk1.7.0/bin/java
2. Configure Java Environment settings
[Root@exkpicture ~]# Vim/etc/profile
Add the following at the end of the file:
Export java_home=/usr/java/jdk1.7.0
export jre_home= $JAVA _home/jre
export path= $PATH: $JAVA _home/bin
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
After saving exit
Source/etc/profie
This deployment is complete.
Thank you for reading, I hope to help you, thank you for your support for this site!