linux切换JDK版本
2015-07-17 18:53
531 查看
Check what are the java versions are installed on your system
#java -version
Example output
OpenJDK Runtime Environment (build 1.6.0-b09)
OpenJDK Client VM (build 1.6.0-b09, mixed mode)
So now I want to change the one version to another version.
If more than one java is installed. Execute below command to see how many java versions are installed? And what is the default version (Default version will be indicated by *)
#update-alternatives –config java
This command will display which is default java version used by your machine..
Example output.
# update-alternatives –config java
There are 2 programs which provided ‘java’.
Selection Command
———————————————–
1. /usr/lib/jvm/jre-1.4.2-gcj/bin/java
*+ 2 /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
Enter to keep the current selection[+], or type selection number:
![](http://i2.wp.com/www.linuxnix.com/wp-content/uploads/2013/01/Linuxnix-free-e-book.png)
So if you want to change the java version from 1.6 (now 2 is default version as shown) to 1.4 just press “1” with
out quotes.
Please let us know if you know other way of changing java version.
Please visit http://www.linuxnix.com for more linux admin stuff
本文来自于:
http://www.linuxnix.com/2010/12/how-to-change-the-java-version-in-linux.html
#java -version
Example output
OpenJDK Runtime Environment (build 1.6.0-b09)
OpenJDK Client VM (build 1.6.0-b09, mixed mode)
So now I want to change the one version to another version.
If more than one java is installed. Execute below command to see how many java versions are installed? And what is the default version (Default version will be indicated by *)
#update-alternatives –config java
This command will display which is default java version used by your machine..
Example output.
# update-alternatives –config java
There are 2 programs which provided ‘java’.
Selection Command
———————————————–
1. /usr/lib/jvm/jre-1.4.2-gcj/bin/java
*+ 2 /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
Enter to keep the current selection[+], or type selection number:
![](http://i2.wp.com/www.linuxnix.com/wp-content/uploads/2013/01/Linuxnix-free-e-book.png)
So if you want to change the java version from 1.6 (now 2 is default version as shown) to 1.4 just press “1” with
out quotes.
Please let us know if you know other way of changing java version.
Please visit http://www.linuxnix.com for more linux admin stuff
本文来自于:
http://www.linuxnix.com/2010/12/how-to-change-the-java-version-in-linux.html
相关文章推荐
- Linux GCC常用命令
- linux service命令
- linux_Makefile文件的编写
- 每天一个linux命令(30): chown命令
- linux C进程信息查询
- Linux系统下挂载windows(双系统)的NTFS文件系统
- CentOS系统中常用查看日志命令
- Linux随笔-鸟哥Linux服务器篇学习总结(全)
- CentOS 7 / RHEL 7 上安装 LAMP + phpMyAdmin
- linux下mysql的root密码忘记解决方法:
- 浅析 Linux 初始化 init 系统
- 每天一个Linux命令yes
- Linux为什么最多能分4个四个主分区
- centos最小化安装后再安装图形界面
- linux等待队列wait_queue_head_t和wait_queue_t
- Centos6.4建立本地yum源
- 转 linux目录介绍
- Linux驱动开发必看-Linux启动过程(转)
- 辛星整理3linux笔记,免费下载点,我希望对你有所帮助
- linux的档案权限和目录配置