linux下安装JDK1.7

linux下安装JDK1.7
安装JDK1.7时的问题及解决过程:
1.rpm后可能出现N多Error,不要怕,继续向下走:
[husher@localhost tool]$ rpm -ivh jdk-7u15-linux-i586.rpm
error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)
[husher@localhost tool]$ su
Password:
[root@localhost tool]# rpm -ivh jdk-7u15-linux-i586.rpm
Preparing...                ########################################### [100%]
   1:jdk                    ########################################### [100%]
Unpacking JAR files...
    rt.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_15/jre/lib/rt.pack
    jsse.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_15/jre/lib/jsse.pack
    charsets.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_15/jre/lib/charsets.pack
    tools.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_15/lib/tools.pack
    localedata.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_15/jre/lib/ext/localedata.pack
    plugin.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_15/jre/lib/plugin.pack
    javaws.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_15/jre/lib/javaws.pack
    deploy.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_15/jre/lib/deploy.pack

2.配置$PATH:vi /etc/profile
#在/etc/profile的最后加上这一段就好了
set JAVA_HOME=/usr/java/jdk1.7.0_15
export JAVA_HOME
set PATH=$PATH:$JAVA_HOME
export PATH
set CLASSPATH=.:JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export CLASSPATH

3.看看jdk是否安装成功:
[root@localhost tool]# java -version
java version "1.7.0_15"
Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
Java HotSpot(TM) Client VM (build 23.7-b01, mixed mode, sharing)
[root@localhost tool]# javac -version
javac 1.7.0_15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值