如何在centos中降级java版本?
How to Downgrade java version in centos?
我已经在 Centos 6.7 中安装了 java,版本为:
java -version
java version "1.6.0_38"
OpenJDK Runtime Environment (IcedTea6 1.13.10) (rhel-1.13.10.0.el6_7-x86_64)
OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)
我想将 java 版本降级到
java -version
java version "1.6.0_17"
OpenJDK Runtime Environment (IcedTea6 1.7.10) (rhel-1.20.b17.el5-x86_64)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)
如何实现?
尝试从 Java 下载并安装特定版本,然后更改 Java 主路径。
安装你需要的版本,
# cd /<place you want java installed>/
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/<version>/jdk-<version>-linux-x64.tar.gz"
# tar xzf jdk-<version>-linux-x64.tar.gz
安装 Java 和备选方案,
# cd /<place java install>/jdk1.6.0_17/
# alternatives --install /usr/bin/java java /opt/jdk1.6.0_17/bin/java 2
# alternatives --config java
然后select版本想要
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
* + 1 /opt/jdk1.6.0_38/bin/java
2 /opt/jdk1.6.0_17/bin/java
Enter to keep the current selection[+], or type selection number:
输入 2
我已经在 Centos 6.7 中安装了 java,版本为:
java -version
java version "1.6.0_38"
OpenJDK Runtime Environment (IcedTea6 1.13.10) (rhel-1.13.10.0.el6_7-x86_64)
OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)
我想将 java 版本降级到
java -version
java version "1.6.0_17"
OpenJDK Runtime Environment (IcedTea6 1.7.10) (rhel-1.20.b17.el5-x86_64)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)
如何实现?
尝试从 Java 下载并安装特定版本,然后更改 Java 主路径。
安装你需要的版本,
# cd /<place you want java installed>/
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/<version>/jdk-<version>-linux-x64.tar.gz"
# tar xzf jdk-<version>-linux-x64.tar.gz
安装 Java 和备选方案,
# cd /<place java install>/jdk1.6.0_17/
# alternatives --install /usr/bin/java java /opt/jdk1.6.0_17/bin/java 2
# alternatives --config java
然后select版本想要
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
* + 1 /opt/jdk1.6.0_38/bin/java
2 /opt/jdk1.6.0_17/bin/java
Enter to keep the current selection[+], or type selection number:
输入 2