- Download JDK to Oracle (Oracle) no more.
- Tar zxvf ****.tar.gz (****.tar.gz is the downloaded file name, unzip. )
- MV * * * * JDK (* * * is your extracted folder, change the name, I changed to JDK, love change what, I change this good to remember)
- MV jdk/usr/local/(then put the renamed folder to/usr/local/)
- Vi/etc/profile (edit config, environment variable bar)
- Last side join:
- Java_home=/usr/local/jdk
- Export JRE_HOME=/USR/LOCAL/JDK/JRE
- Export classpath=.: $JAVA _home/lib: $JRE _home/lib: $CLASSPATH
- Export path= $JAVA _home/bin: $JRE _home/bin: $PATH
- Then modify the default JDK:
- Update-alternatives--install/usr/bin/java Java/usr/java/bin/java 300
- Update-alternatives--install/usr/bin/javac Javac/usr/java/bin/javac 300
- Update-alternatives--config Java
- Update-alternatives--config Javac
- Finally see the success?
- Java-version
- Javac-version
Centos6.6 Tar Package installation JDK