如何用新安裝的jdk替換掉Linux系統預設jdk
系統自帶的JDK
[root@master ~]# java -version
java version "1.5.0"
gij (GNU libgcj) version 4.4.7 20120313 (Red Hat 4.4.7-3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
自己配置的jdk
[hadoop@master ~]$ echo $JAVA_HOME
/usr/java/jdk1.8.0_60
但是系統預設的用的是系統自帶的jdk,下面切換到安裝的jdk版本
[root@master ~]# alternatives --install /usr/bin/java java /usr/java/jdk1.8.0_60/bin/java 300
[root@master ~]# alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
2 /usr/java/jdk1.8.0_60/bin/java
Enter to keep the current selection[+], or type selection
number: 2
系統自帶的jdk時,是帶gij的,輸入java命令如下:
[root@master ~]# java -version
java version "1.5.0"
gij (GNU libgcj) version 4.4.7 20120313 (Red Hat 4.4.7-3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
自己安裝的jdk,輸入java命令如下:
[root@master ~]# java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29812844/viewspace-2122312/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- linux 主機上更換預設的jdkLinuxJDK
- Linux系統快速安裝JDKLinuxJDK
- Redhat Enterprise Linux 6.4 安裝Oracle JDK替換OpenJDKRedhatLinuxOracleJDK
- Linux安裝jdk及jdk版本之間切換LinuxJDK
- 如何用xml替換掉structs中的tagXMLStruct
- liunx系統安裝jdk的方法JDK
- Linux下jdk的安裝解除安裝切換LinuxJDK
- Linux系統安裝jdk——.tar.gz版LinuxJDK
- linux系統安裝jdk,配置環境變數LinuxJDK變數
- Windows環境安裝Linux系統及JDK部署WindowsLinuxJDK
- 設定maven預設的jdk版本MavenJDK
- linux 安裝jdkLinuxJDK
- Linux安裝JDKLinuxJDK
- linux 設定 jdkLinuxJDK
- 如何在linux系統下安裝jdk並設定環境變數LinuxJDK變數
- 如何在ubuntu系統下安裝jdkUbuntuJDK
- Linux(七)——安裝JDKLinuxJDK
- linux 安裝 Jdk 1.6.45LinuxJDK
- Linux安裝JDK流程LinuxJDK
- linux 下安裝 jdkLinuxJDK
- Centos/linux下的JDK安裝CentOSLinuxJDK
- MyEclipse - 修改Maven預設的Jdk版本EclipseMavenJDK
- 在Linux下安裝JDKLinuxJDK
- Linux安裝jdk環境LinuxJDK
- Linux7安裝JDKLinuxJDK
- Linux安裝JDK1.8LinuxJDK
- Linux解除安裝jdk方法LinuxJDK
- linux 安裝JDK1.7LinuxJDK
- Linux環境安裝jdkLinuxJDK
- Linux 安裝 JDK17LinuxJDK
- Linux下安裝JDK及環境設定LinuxJDK
- linux 解除安裝jdk和安裝LinuxJDK
- JDK安裝JDK
- 安裝JDKJDK
- Linux下載jdk ,Linux如何下載jdkLinuxJDK
- Linux(CentOS)安裝JDK1.8LinuxCentOSJDK
- Linux伺服器---安裝jdkLinux伺服器JDK
- CentOS Linux7 安裝JDKCentOSLinuxJDK