+ -
当前位置:首页 → 问答吧 → 当我把fedora换成debian时,我才发现,连J2SDK也不能安。请问:

当我把fedora换成debian时,我才发现,连J2SDK也不能安。请问:

时间:2005-04-11

来源:互联网

请顺如何安装J2SDK呢?我可是靠它吃饭的啊。我在教育网内。
还有,我刚刚换成DEBIAN。但我想知道,这个源列表怎么能保持最新?

如何安J2SDK?谢谢。

作者: jiahaolin   发布时间: 2005-04-11

http://wiki.osuosl.org/display/DEV/Java+on+Debian

作者: xqkz   发布时间: 2005-04-11

楼上的朋友,我在教育网内,上不去这个网站啊。。。。。。。。。

作者: jiahaolin   发布时间: 2005-04-11

http://www.ubuntu.org.cn/StarterGuide#jre

作者: qazwer   发布时间: 2005-04-11

上面都是指装j2re吧。。。楼主要j2sdk...

作者: Hewllet   发布时间: 2005-04-11

Java on Debian
Last changed on May 11, 2004 by Danny Robert
The following document should lead you by the hand and help you install Java on your box. The reason this isn't a script is because the Java installer seems to change every version, and it doing it by hand is a stepping stone to installing alternative JVMs. So hopefully you get a working install and learn a little about Debian and Java while doing it.
Grab the Java SDK
Sun Java J2SE SDK (1.4.2_04) You want the SDK and Documentation
Installation
Note: Substitute correct version numbers for packages and files when installing future versions.
Upgrade Debian to the latest packages

apt-get update
apt-get -u upgrade
apt-get -u dist-upgrade

Install Debian packages for handling unpackaged software.

apt-get update
apt-get install kaffe equivs java-common java2-common

Install Java SDK

1. Download J2SE SDK components to

/var/install/java/1.4.2

2. Change to install dir:

cd /var/install/java/1.4.2

3. Make sure you have write permissions to the directory.
4. Make installer executable:

chmod a+x j2sdk-1.4.2_04-linux-i586.bin

5. su to root:

sudo su

6. Run the installer:

./j2sdk-1.4.2_04-linux-i586.bin

This will create the directory j2sdk1.4.2_04 with many files and directories in it.
7. Unzip the docs (you did download the docs from the Java website didn't you?):

unzip j2sdk-1.4.2-doc.zip

This will create the directory docs.
8. Move the docs into the SDK:

mv docs j2sdk1.4.2_04

9. su to root:

sudo su

10. Change the ownership of the java files:

chown -R root:src j2sdk1.4.2_04

Note: root should own all system files like java. The group src is short for source as in code. That's the group we are using for users allowed to compile source code.
11. Move the SDK directory tree to the final runtime location:

mv j2sdk1.4.2_04/ /usr/local/lib/

12. Create link:

ln -s /usr/local/lib/j2sdk1.4.2_04 /usr/local/lib/jdk

Note: This link should be used everywhere to refer to the path of the JDK and JRE. Always use /usr/local/lib/jdk… and do not use /usr/local/lib/j2sdk1.4.2_04. This allows easier upgrading in the future and multiple versions of java to be installed simultaneously.
13. Tell Debian that java has been installed. Use the "dummy" package control files provided by java-common to satisfy Debian packing dependencies. NOTE: if you are OSUOSL 'apt-get install java2-compiler-dummy java-compiler-dummy java2-runtime-dummy java-virtual-machine-dummy' and skip to 15.

cd /var/install/java
mkdir pkg
cd pkg
cp /usr/share/doc/java-common/dummy-packages/*.control /var/install/java/pkg/
equivs-build java-compiler-dummy.control
equivs-build java-virtual-machine-dummy.control
equivs-build java2-runtime-dummy.control
equivs-build java2-compiler-dummy.control

14. You should now have 5 packages in /var/install/java/pkg. Install them with dpkg:

dpkg -i java-compiler-dummy_1.0_all.deb java-virtual-machine-dummy_1.0_all.\
deb java2-compiler-dummy_1.0_all.deb java2-runtime-dummy_1.0_all.deb

15. Tell Debian to use our new JDK: Run this shell script * NOTE: The command update-alternatives is used in Debian to choose which of several packages to use when several can do the same thing. ("Java" can be provided by kaffe, blackdown, and Sun, etc.) See "man update-alternatives" for details.*
16. Run java once as root (you're still root) to allow system preference directories to be created and check that Sun's java is running: java -version
17. Update the JAVA_HOME environment variable and the path in /etc/profile or /home/$USER/.bash_profile or /root/.profile:

export JAVA_HOME="/usr/local/lib/jdk"
export JDK_HOME="${JAVA_HOME}"
export PATH="${JAVA_HOME}/bin:${PATH}"

18. To totally reset the environment variables, you need to reboot
NOTE: Leave the directory /var/install/java and its contents. You may need it again later for uninstallation

Mozilla-Firefox Configuration
Run the following command as root:

ln -s /usr/local/lib/jdk/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so \
/usr/lib/mozilla-firefox/plugins/libjavaplugin_oji.so

Mozilla Configuration
Run the following command as root:

ln -s /usr/local/lib/jdk/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so \
/usr/lib/mozilla/plugins/libjavaplugin_oji.so

Getting Eclipse

apt-get install eclipse-sdk eclipse-source

第十五步有一个脚本,见附件,tar解压。
上传的附件
java.tar.gz (821 字节, 9 次查看)

作者: xqkz   发布时间: 2005-04-11

主要是就是下载j2sdk,执行解压,然后设置一下JAVA_HOME就差不多了吧。
在Debian发行版有几个关于Java在Debian上安装的贴子。你可以看一看。

作者: xqkz   发布时间: 2005-04-11

谢谢。搞定了。

作者: jiahaolin   发布时间: 2005-04-11

热门下载

更多