linux下安装jdk

作者:神秘网友 发布时间:2020-09-07 20:27:29

linux下安装jdk

linux下安装jdk

安装说明

系统环境:centos-6.5
安装方式:rpm安装
软件:jdk-7-linux-x64.rpm
下载地址:http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html

安装

linux下安装jdk

[root@localhost ~]# rpm -ivh jdk-7u71-linux-x64.rpm 

报错:

[root@localhost ~]# rpm -ivh jdk-7u71-linux-x64.rpm 
Preparing...                ########################################### [100%]
   1:jdk                    ########################################### [100%]
Unpacking JAR files...
    rt.jar...
    jsse.jar...
    charsets.jar...
    tools.jar...
    localedata.jar...
    jfxrt.jar...

unpacking不用管,并不是报错,jar已经安装成功
linux下安装jdk

配置环境变量

进入下面路径

[root@localhost ~]# cd /usr/local/

添加下面的配置

[root@localhost ~]# vi + /etc/profile
向文件里面追加以下内容:
JAVA_HOME=/usr/java/jdk1.7.0
JRE_HOME=/usr/java/jdk1.7.0/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH
[root@localhost local]# source /etc/profile

查看配置

[[email protected] local]# source /etc/profile
[[email protected] local]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/java/jdk1.7.0/bin:/usr/java/jdk1.7.0/jre/bin
[[email protected] ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/java/jdk1.7.0/bin:/usr/java/jdk1.7.0/jre/bin

linux下安装jdk相关教程

  1. Linux学习笔记-----自动挂载autofs
  2. linux内核基础
  3. linux简介
  4. Ubuntu 意外死机 (Linux Crash/Hang)解决
  5. windows x64 即64位操作系统下php7安装
  6. LINUX进程管理
  7. CentOS 7安装Mysql5.7
  8. 安装bochs debugger GUI