linux安装jdk (当前环境Debian)

由于测试机系统是 Debian x86_64 GNU/Linux   64位系统
故jdk版本也必须是64位----  jdk-6u27-linux-x64.bin
# cd /data/postmall
# chmod u+x jdk-6u27-linux-x64.bin
# ./jdk-6u27-linux-x64.bin
# cp -r /data/postmall/jdk1.6.0_27  /usr/local/jdk     复制之后,可以把/data/postmall/下的jdk目录和.bin文件删除,然后在系统初始化脚本中设置java环境变量,
# vi /etc/profile
在umask 022下面添加以下设置内容:
export JAVA_HOME=/usr/local/jdk
export JRE_HOME=/usr/local/jdk/jre
export PATH=$PATH:/usr/local/jdk/bin
export CLASSPATH=./:/usr/local/jdk/lib:/usr/local/jdk/jre/lib
保存,退出!
shell> source /etc/profile    #使之立即生效
【建议也设置默认启动】
# vi /etc/rc.local
加上:
export JAVA_HOME=/usr/local/jdk
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export CLASSPATH=.:/usr/local/jdk/lib:/usr/local/jdk/jre/lib:$CLASSPATH
export JRE_HOME=/usr/local/jdk/jre
保存,退出!

退出终端,重启登陆,然后 # java -version 如果有java版本号出来表示成功。


之前在debian上安装jdk一直报错:

root@debian-han:/home/jinzhu/jdk# rpm -ivh jre-7u6-linux-x64.rpm 
rpm: RPM should not be used directly install RPM packages, use Alien instead!
rpm: However assuming you know what you are doing...
error: Failed dependencies:
	/bin/basename is needed by jre-1.7.0_06-fcs.x86_64
	/bin/cat is needed by jre-1.7.0_06-fcs.x86_64
	/bin/cp is needed by jre-1.7.0_06-fcs.x86_64
	/bin/gawk is needed by jre-1.7.0_06-fcs.x86_64
	/bin/grep is needed by jre-1.7.0_06-fcs.x86_64
	/bin/ln is needed by jre-1.7.0_06-fcs.x86_64
	/bin/ls is needed by jre-1.7.0_06-fcs.x86_64
	/bin/mkdir is needed by jre-1.7.0_06-fcs.x86_64
	/bin/mv is needed by jre-1.7.0_06-fcs.x86_64
	/bin/pwd is needed by jre-1.7.0_06-fcs.x86_64
	/bin/rm is needed by jre-1.7.0_06-fcs.x86_64
	/bin/sed is needed by jre-1.7.0_06-fcs.x86_64
	/bin/sort is needed by jre-1.7.0_06-fcs.x86_64
	/bin/touch is needed by jre-1.7.0_06-fcs.x86_64
	/usr/bin/cut is needed by jre-1.7.0_06-fcs.x86_64
	/usr/bin/dirname is needed by jre-1.7.0_06-fcs.x86_64
	/usr/bin/expr is needed by jre-1.7.0_06-fcs.x86_64
	/usr/bin/find is needed by jre-1.7.0_06-fcs.x86_64
	/usr/bin/tail is needed by jre-1.7.0_06-fcs.x86_64
	/usr/bin/tr is needed by jre-1.7.0_06-fcs.x86_64
	/usr/bin/wc is needed by jre-1.7.0_06-fcs.x86_64
	/bin/sh is needed by jre-1.7.0_06-fcs.x86_64


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值