suse 查看java版本_openSUSE 12.1安装JDK 1.7的方法

Now you have to setup the alternatives so you can use switch

between Iced Tea, which is default, and the Oracle Java.

First install the alternative:

sudo /usr/sbin/update-alternatives

--install "/usr/bin/java" "java" "/usr/java/jdk1.7.0_01/bin/java"

40

Now install the alternative for your browser plugin:

sudo /usr/sbin/update-alternatives --install

"/usr/lib/browser-plugins/javaplugin.so" "javaplugin"

"/usr/java/jdk1.7.0_01/jre/lib/i386/libnpjp2.so" 40

Note: the first quotes are pointing to the path, the the name of

the alternative script, and the 3rd is the location to point to.

The numbers at the end is the priority in case it was set to

automode.

Now you have to configure the alternatives, first we’ll do

java:

sudo /usr/sbin/update-alternatives

java (这里有报错 )

根据openSUSE的官网提示:

在多个版本的 JAVA JRE 或 JDK 中转换

目前 JAVA 软件包使用 update-alternatives 命令。

root 权限执行:

update-alternatives --config java

把所有 JRE 相关链接指向一个 JRE 版本,然后

update-alternatives --config javac

把所有 JDK 相关链接指向一个 JDK 版本

这个命令会列出安装的所有 JRE/JDK 版本便于你控制。

使用:

linux-2szk:/usr/lib/jvm

# sudo /usr/sbin/update-alternatives javapluginupdate-alternatives:

error: unknown argument `javaplugin'

linux-2szk:/usr/lib/jvm

# update-alternatives --config java

There

are 2 choices for the alternative java (providing

/usr/bin/java).

Selection Path Priority Status

------------------------------------------------------------

*

0 /usr/lib/jvm/jre-1.6.0-openjdk/bin/java 17105 auto mode

1 /usr/java/jdk1.7.0_01/bin/java 40 manual mode

2 /usr/lib/jvm/jre-1.6.0-openjdk/bin/java 17105 manual mode

Press

enter to keep the current choice[*], or type selection number:

1

update-alternatives:

using /usr/java/jdk1.7.0_01/bin/java to provide /usr/bin/java

(java) in manual mode.

linux-2szk:/usr/lib/jvm #

java -version

java version

"1.7.0_01"

Java(TM) SE Runtime

Environment (build 1.7.0_01-b08)

Java HotSpot(TM) Server VM

(build 21.1-b02, mixed mode)

Choose the number associated with /usr/java/jdk1.7.0_01/bin/java,

in my case it was 1.

Now lets configure javaplugin:

sudo /usr/sbin/update-alternatives javaplugin

Choose the number associated with

/usr/java/jdk1.7.0_01/jre/lib/i386/libnpjp2.so, in my case it was

1.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值