LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 3092|回复: 5

转贴:《Ubuntu下JAVA的安装》--个人认为最理想的安装方法,按步骤可以完全OK。

[复制链接]
发表于 2004-12-5 20:09:38 | 显示全部楼层 |阅读模式
I've used another method to install Java an the Java plugins for Firefox. This one is not listed on the Ubuntu Wiki and I can't find it here too.
It seems to be the (new) correct way to install Sun JDK on Ubuntu/Debian.

1) Install java-common and equivs with apt-get.
Code:
         sudo apt-get install java-common equivs

2) Follow (with adaptations) instructions in file:///usr/share/doc/java-common/d...ch11.html#s11.3 (installed by java-common). In a Root Terminal (Applications > System Tools > Root Terminal).[进入终端按照下面按下面执行操作]
Code:
# cd /var/install
# mkdir java
# cd java
# wget http://copy.the.correct/url/from/your/browser -O jdk-1_5_0-linux-i586.bin #/这里是下载JDK,可使用其他方式或软件下载后放到此目录就可以里。/#
# chmod +x jdk-1_5_0-linux-i586.bin
# ./jdk-1_5_0-linux-i586.bin
# mv jdk1.5.0 /usr/local/lib
# ln -s /usr/local/lib/jdk1.5.0 /usr/local/lib/jdk
# mkdir pkg
# cd pkg
# cp /usr/share/doc/java-common/dummy-packages/*.control .
# equivs-build java1-runtime-dummy.control
# equivs-build java-compiler-dummy.control
# equivs-build java2-compiler-dummy.control
# equivs-build java2-runtime-dummy.control
# equivs-build java-virtual-machine-dummy.control
# dpkg -i *.deb
# update-alternatives --verbose --install /usr/bin/java java /usr/local/lib/jdk/bin/java 500 --slave /usr/share/man/man1/java.1 java.1 /usr/local/lib/jdk/man/man1/java.1
# ln -s /usr/local/lib/jdk/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla-firefox/plugins/libjavaplugin_oji.so
# java -version

The output of the last command should be something like
Code:
java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64) Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)

You should now have a full and working Java environment.
发表于 2004-12-5 20:40:30 | 显示全部楼层
麻烦,用 java-package 工具制作 j2sdk 的 deb 包比这简单多了。
发表于 2004-12-5 21:06:19 | 显示全部楼层
哈哈,真是吃力不讨好
 楼主| 发表于 2004-12-5 21:47:10 | 显示全部楼层
呵呵斑竹批评的是。不过这个过程感觉能知道的更多一点。而且成就感似乎大一点。呵呵。
发表于 2004-12-16 21:54:20 | 显示全部楼层
我觉得这个安装方法挺好的
可以自己去下载最新版本的JDK

Debian不止可以用apt-get!
发表于 2004-12-20 16:59:42 | 显示全部楼层
我装的是Sarge,用apt-get install安装,说找不到java-package...
请问如何得到java-package??
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表