怎样更改Linux中默认的openjdk为自己安装的JDK
系统自带jdk
[ ~]# java -version java version "1.5.0" gij (GNU libgcj) version 4.4.7 20120313 (Red Hat 4.4.7-23) 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
alternatives --install /usr/bin/java java /usr/java/jdk1.8.0_60/bin/java 300 [ ~]# alternatives --config java There are 4 programs which provide ‘java‘. Selection Command ----------------------------------------------- *+ 1 /usr/lib/jvm/jre-1.5.0-gcj/bin/java 2 /usr/java/jdk1.7.0_67-cloudera/bin/java 3 /usr/java/jdk1.7/bin/java 4 /usr/local/jdk1.7/bin/java Enter to keep the current selection[+], or type selection number: 4
切换后
[ ~]# java -version java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
相关推荐
lonesomer 2020-09-17
Locksk 2020-10-12
佛系程序员J 2020-10-10
gdb 2020-09-14
zousongshan 2020-08-10
hell0kitty 2020-07-28
malonely 2020-07-20
missingmuch 2020-07-19
eternityzzy 2020-07-19
wangrui0 2020-06-28
一世为白 2020-06-21
MAC2007 2020-06-16
凉白开 2020-06-17
zhangwentaohh 2020-06-14
liangston 2020-06-14
linzb 2020-06-14
89421478 2020-06-12