HowTo: Install sun's jre-1_5_0_05 the non-repo way

参与到Ubuntu的翻译中来
回复
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

HowTo: Install sun's jre-1_5_0_05 the non-repo way

#1

帖子 oneleaf » 2005-10-31 11:36

I hope this will be useful to someone. I couldn't find java-package in the repositories because I hadn't added multiverse. So, I installed java in a different way.

First, download the linux runtime installer here. Do NOT get the rpm! Get the one that says Linux (self-extracting file).

After downloading, cd to where you downloaded the file and run:
Code:

sudo mv jre-1_5_0_05-linux-i586.bin /usr/local cd /usr/local sudo chmod a+x jre-1_5_0_05-linux-i586.bin sudo sh jre-1_5_0_05-linux-i586.bin

Say 'yes' to the license agreement and watch it extract the files into a folder called jre1.5.0_05
You're almost done. Now you want to install the plugin for firefox:
Code:

cd /usr/lib/mozilla-firefox/plugins sudo ln -s /usr/local/jre1.5.0_05/plugin/i386/ns7/libjavaplugin_oji.so

Firefox is now happily running java applets.
The final steps are:
Code:

sudo ln -sf /usr/local/jre1.5.0_05/bin/java_vm /usr/bin/java_vm sudo update-alternatives --install /usr/bin/java java /usr/local/jre1.5.0_05/bin/java 1


And now the java runtime environment appears in your list of choices when running 'sudo update-alternatives --config java'! Go ahead and run that, and chose the sun java option. Then to check to make sure it worked, run 'java -version', which should output something like this:
Code:

java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)

Done!

If you want to do some configurating with the java control pannel, run 'sh /usr/local/jre1.5.0_05/bin/ControlPanel'.

Enjoy!


=========================
Removal Instructions

If the time comes when you need/want to remove java, these commands will do the trick if you followed the howto exactly:
Code:

sudo rm /usr/lib/mozilla-firefox/plugins/libjavaplugin_oji.so sudo rm /usr/bin/java_vm sudo update-alternatives --remove java /usr/local/jre1.5.0_05/bin/java


Then you'll want to open up a root nautilus and go to /usr/loca/ and delete the jre1.5.0_05 folder. That should do it.


http://ubuntuforums.org/showthread.php? ... light=java
头像
bytedog
帖子: 29
注册时间: 2005-10-16 12:40

#2

帖子 bytedog » 2005-11-03 16:36

我希望这篇文档对大家有帮助。由于添加不了multiverse这个源,我无法从源中安装java-package这个包,因此我使用了其它方法安装java。

首先,下载(java的)Linux Runtime安装包到本地,注意:不要下载rpm包!下载那个名字为Linux Self-Extracting Binary的文件。注:jre-1_5_0_05-linux-i586.bin

下载后,更改当前目录为你放文件的目录,运行以下命令:
sudo mv jre-1_5_0_05-linux-i586.bin /usr/local cd /usr/local sudo chmod a+x jre-1_5_0_05-linux-i586.bin
sudo sh jre-1_5_0_05-linux-i586.bin

在 license agreement(许可证)页面,输入'yes',文件将解压到jre1.5.0_05目录,安装就接近结束了。现在开始安装firefox的plugin。命令如下:
cd /usr/lib/mozilla-firefox/plugins
sudo ln -s /usr/local/jre1.5.0_05/plugin/i386/ns7/libjavaplugin_oji.so

现在firefox就可以执行java script了。

最后一步:
sudo ln -sf /usr/local/jre1.5.0_05/bin/java_vm /usr/bin/java_vm
sudo update-alternatives --install /usr/bin/java java /usr/local/jre1.5.0_05/bin/java 1

现在当你运行'sudo update-alternatives --config java'时,刚刚安装的JRE就出现在列表中,选择sun java选项,然后运行 'java -version'命令,确保它能运行。命令输出如下:

java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)

完成!

如果你想使用java控制面板修改一些配置,可以运行以下命令:
'sh /usr/local/jre1.5.0_05/bin/ControlPanel'。

=================================================
卸载指南

如果你想删除java环境,以下的命令可以帮助你完成工作(如果你严格按照howto进行)。
sudo rm /usr/lib/mozilla-firefox/plugins/libjavaplugin_oji.so
sudo rm /usr/bin/java_vm
sudo update-alternatives --remove java /usr/local/jre1.5.0_05/bin/java

然后你可以打开一个nautilus(root权限),然后进入/usr/loca/目录并删除 jre1.5.0_05目录就可以了。
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#3

帖子 oneleaf » 2005-11-08 13:18

头像
内存不足
论坛版主
帖子: 3277
注册时间: 2005-08-18 18:43
联系:

#4

帖子 内存不足 » 2005-11-08 13:55

如果要装1。5是不是要先卸载1.4.
໌→ iCookie Gtk Theme
໌→DropPlusBluetheme
กรัก กรัก`菠萝
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#5

帖子 oneleaf » 2005-11-08 14:15

不用。
头像
内存不足
论坛版主
帖子: 3277
注册时间: 2005-08-18 18:43
联系:

#6

帖子 内存不足 » 2005-11-08 15:00

好,再当回老鼠。
໌→ iCookie Gtk Theme
໌→DropPlusBluetheme
กรัก กรัก`菠萝
头像
内存不足
论坛版主
帖子: 3277
注册时间: 2005-08-18 18:43
联系:

#7

帖子 内存不足 » 2005-11-12 15:10

执行sudo update-alternatives --config java命令后我这里出来这么多的java版本,是否可以把3、4两项删除?3、4两项都是在这之前用新立得安装的。

代码: 全选

$ sudo update-alternatives --config java

There are 5 alternatives which provide `java'.

  Selection    Alternative
-----------------------------------------------
      1        /usr/bin/gij-wrapper-4.0
 +    2        /usr/lib/jvm/java-gcj/bin/java
      3        /usr/lib/j2re1.5-sun/bin/java
      4        /usr/lib/j2sdk1.5-sun/bin/java
*     5        /usr/local/jre1.5.0_05/bin/java

Press enter to keep the default[*], or type selection number:
໌→ iCookie Gtk Theme
໌→DropPlusBluetheme
กรัก กรัก`菠萝
头像
millenniumdark
论坛版主
帖子: 4159
注册时间: 2005-07-02 14:41
系统: Ubuntu 14.04 (Kylin)
联系:

#8

帖子 millenniumdark » 2006-07-29 20:04

好像过时了
回复