装jdk的时候出现问题;

系统安装、升级讨论
回复
mrscruff
帖子: 2
注册时间: 2007-07-24 16:18
送出感谢: 0
接收感谢: 0

装jdk的时候出现问题;

#1

帖子 mrscruff » 2008-07-12 16:18

在sun的web site上下载了了rpm.bin包,解压后得到rpm包;

步骤1: 用rpm直接安装:

kenry@debian:~/utils$ rpm -ivh jdk-6u7-linux-i586.rpm
error: Failed dependencies:
/bin/basename is needed by jdk-1.6.0_07-fcs.i586
/bin/cat is needed by jdk-1.6.0_07-fcs.i586
/bin/cp is needed by jdk-1.6.0_07-fcs.i586
/bin/gawk is needed by jdk-1.6.0_07-fcs.i586
/bin/grep is needed by jdk-1.6.0_07-fcs.i586
/bin/ln is needed by jdk-1.6.0_07-fcs.i586
/bin/ls is needed by jdk-1.6.0_07-fcs.i586
/bin/mkdir is needed by jdk-1.6.0_07-fcs.i586
/bin/mv is needed by jdk-1.6.0_07-fcs.i586
/bin/pwd is needed by jdk-1.6.0_07-fcs.i586
/bin/rm is needed by jdk-1.6.0_07-fcs.i586
/bin/sed is needed by jdk-1.6.0_07-fcs.i586
/bin/sort is needed by jdk-1.6.0_07-fcs.i586
/bin/touch is needed by jdk-1.6.0_07-fcs.i586
/usr/bin/cut is needed by jdk-1.6.0_07-fcs.i586
/usr/bin/dirname is needed by jdk-1.6.0_07-fcs.i586
/usr/bin/expr is needed by jdk-1.6.0_07-fcs.i586
/usr/bin/find is needed by jdk-1.6.0_07-fcs.i586
/usr/bin/tail is needed by jdk-1.6.0_07-fcs.i586
/usr/bin/tr is needed by jdk-1.6.0_07-fcs.i586
/usr/bin/wc is needed by jdk-1.6.0_07-fcs.i586
/bin/sh is needed by jdk-1.6.0_07-fcs.i586

报错,搜索了一下,网上很多人装rpm包都有这个问题,但是没有解决。

尝试其他方法2:

先用alien 转成deb

allien -d jdk-6u7-linux-i586.rpm
得到:jdk_1.6.0_07-1_i386.deb ,然后安装
dpkg -i jdk_1.6.0_07-1_i386.deb
装上去了,/usr/lib/jdk1.6.0_07

设置环境变量JAVA_HOME, CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

执行 java -version, 报错,找不到java/lang/Object, 很显然,装的不对,$JAVA_HOME/jre/lib里面没有一些
java的基本类。不知道为什么。

请问在ubantu或是debian里面怎么能把jdk装好?
头像
佚之狐L
帖子: 840
注册时间: 2008-01-28 13:02
送出感谢: 0
接收感谢: 0

Re: 装jdk的时候出现问题;

#2

帖子 佚之狐L » 2008-07-12 19:51

mrscruff 写了:在sun的web site上下载了了rpm.bin包,解压后得到rpm包;

步骤1: 用rpm直接安装:

kenry@debian:~/utils$ rpm -ivh jdk-6u7-linux-i586.rpm
error: Failed dependencies:
/bin/basename is needed by jdk-1.6.0_07-fcs.i586
/bin/cat is needed by jdk-1.6.0_07-fcs.i586
/bin/cp is needed by jdk-1.6.0_07-fcs.i586
/bin/gawk is needed by jdk-1.6.0_07-fcs.i586
/bin/grep is needed by jdk-1.6.0_07-fcs.i586
/bin/ln is needed by jdk-1.6.0_07-fcs.i586
/bin/ls is needed by jdk-1.6.0_07-fcs.i586
/bin/mkdir is needed by jdk-1.6.0_07-fcs.i586
/bin/mv is needed by jdk-1.6.0_07-fcs.i586
/bin/pwd is needed by jdk-1.6.0_07-fcs.i586
/bin/rm is needed by jdk-1.6.0_07-fcs.i586
/bin/sed is needed by jdk-1.6.0_07-fcs.i586
/bin/sort is needed by jdk-1.6.0_07-fcs.i586
/bin/touch is needed by jdk-1.6.0_07-fcs.i586
/usr/bin/cut is needed by jdk-1.6.0_07-fcs.i586
/usr/bin/dirname is needed by jdk-1.6.0_07-fcs.i586
/usr/bin/expr is needed by jdk-1.6.0_07-fcs.i586
/usr/bin/find is needed by jdk-1.6.0_07-fcs.i586
/usr/bin/tail is needed by jdk-1.6.0_07-fcs.i586
/usr/bin/tr is needed by jdk-1.6.0_07-fcs.i586
/usr/bin/wc is needed by jdk-1.6.0_07-fcs.i586
/bin/sh is needed by jdk-1.6.0_07-fcs.i586

报错,搜索了一下,网上很多人装rpm包都有这个问题,但是没有解决。

尝试其他方法2:

先用alien 转成deb

allien -d jdk-6u7-linux-i586.rpm
得到:jdk_1.6.0_07-1_i386.deb ,然后安装
dpkg -i jdk_1.6.0_07-1_i386.deb
装上去了,/usr/lib/jdk1.6.0_07

设置环境变量JAVA_HOME, CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

执行 java -version, 报错,找不到java/lang/Object, 很显然,装的不对,$JAVA_HOME/jre/lib里面没有一些
java的基本类。不知道为什么。

请问在ubantu或是debian里面怎么能把jdk装好?

代码: 全选

sudo apt-get install sun-java6-jdk
手动也行
https://cds.sun.com/is-bin/INTERSHOP.en ... P_zb8gqA==
下载jdk-6u7-linux-i586.bin复制到/tmp

代码: 全选

cd /tmp
./jdk-6u7-linux-i586.bin
安装过程中需要你回答是否同意使用协议(终端中红蓝色的提示界面),此时按 tab
键至 OK,再按回车即可正常安装
设置当前默认的 java 解释器:

代码: 全选

sudo update-alternatives --config java
执行后会出现类似如下的画面:(没安jre就不用这一步了)
There are 2 alternatives which provide `java'.
Selection Alternative
-----------------------------------------------
1 /usr/bin/gij-wrapper-4.1
*+ 2 /usr/lib/jvm/java-6-sun/jre/bin/java
Press enter to keep the default[*], or type selection number:
输入 有包含 "sun" 的行的前面的数字。如上面显示,则输入 2,然后回车确定。
配置 JAVA 环境变量:

代码: 全选

sudo gedit /etc/environment
在其中添加如下两行:
CLASSPATH=.:/usr/lib/jvm/java-6-sun/lib
JAVA_HOME=/usr/lib/jvm/java-6-sun

代码: 全选

sudo gedit /etc/jvm
将文件中的
/usr/lib/jvm/java-6-sun
这一行填入到配置块的顶部
安装浏览器的 JAVA Plugin(可选):

代码: 全选

sudo apt-get install sun-java6-plugin
java 中文支持(或乱码的解决):java 程序是跨平台的,但需要解决中文支持问题。
方法很简单,就是在 java 安装目录下放进去一个中文字体即可。

代码: 全选

cd /usr/lib/jvm/java-6-sun/jre/lib/fonts
sudo mkdir fallback
cd fallback
sudo ln -s ~/.fonts/fireflysung.ttf
(我选了最新的文泉驿夸父字体,
/usr/share/fonts/wenquanyi/wqy-zenhei/wqy-zenhei.ttf)

代码: 全选

sudo mkfontdir
sudo mkfontscale
携书弹剑走黄沙,瀚海天山处处家;
大漠西风飞翠羽,江南八月看桂花
mrscruff
帖子: 2
注册时间: 2007-07-24 16:18
送出感谢: 0
接收感谢: 0

#3

帖子 mrscruff » 2008-07-12 22:27

楼上的方法很好!谢谢!

我下了个bin文件直接执行得到jdk目录,也可以用。。

但是不知道为什么rpm转换成deb也不行。。可能是alien程序有问题。

另外在网上看到用fakeroot make-jpkg jdk_xxx.bin转成deb再安装的,也没有成功。
回复

回到 “系统安装和升级”