linux切换JDK版本

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:

Linuxnix-free-e-book

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.






本文来自于:

http://www.linuxnix.com/2010/12/how-to-change-the-java-version-in-linux.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值