linux 配置jdk

作者: ed993a1298b6 | 来源:发表于2018-08-17 16:45 被阅读30次

1、下载jdk

前往下载jdk1.8版本,选择下载Linux x64 压缩包

按照系统对应版本下载

2、上传至Linux服务器

选择存在在/usr/java 目录

解压,输入命令tar -xzvf jdk-8u181-linux-x64.tar.gz

解压后文件夹为 jdk1.8.0_181

3、配置环境变量

编辑环境变量,输入命令 vim /etc/profile
在最后增加:

JAVA_HOME=/usr/java/jdk1.8.0_181
CLASSPATH=$JAVA_HOME/lib/
PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH
效果图

按 Esc 输入:wq命令保存

4、重新加载系统配置文件

[root@localhost java]# source /etc/profile

5、校验

[root@localhost java]# java 

出现以下情况说明配置成功

Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)
where options include:
    -d32      use a 32-bit data model if available
    -d64      use a 64-bit data model if available
    -server   to select the "server" VM
                  The default VM is server.

    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
                  A : separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D<name>=<value>
                  set a system property
    -verbose:[class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:<value>
                  Warning: this feature is deprecated and will be removed
                  in a future release.
                  require the specified version to run
    -showversion  print product version and continue
    -jre-restrict-search | -no-jre-restrict-search
                  Warning: this feature is deprecated and will be removed
                  in a future release.
                  include/exclude user private JREs in the version search
    -? -help      print this help message
    -X            print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
                  enable assertions with specified granularity
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
                  disable assertions with specified granularity
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:<libname>[=<options>]
                  load native agent library <libname>, e.g. -agentlib:hprof
                  see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
                  load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
                  load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
                  show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.

相关文章

  • 2020-10-12

    Linux学习4 Ubuntu20配置JDK 下载JDK 配置环境变量

  • 02.Zookeeper安装

    1、jdk安装 下载linux的jdk1.8.tar,上传至Linux服务器 解压缩jdk,配置jdk(命令:ta...

  • 【Linux】Jenkins安装

    安装环境准备 操作系统:Linux(CentOS7) 软件:jdk,安装及配置步骤见Linux安装jdk 软件:t...

  • JDK的安装与环境变量的配置

    本文包括Windows的JDK和Linux的JDK安装与环境变量的配置。 JDK(java development...

  • Javaweb项目部署到阿里云服务器

    环境配置 下载jdk和tomcat jdk下载地址 前往下载 jdk下载包括linux和window,下载对...

  • Linux下配置JDK和Jmeter

    一:JDK配置 1、先下载对应的JDK包放到linux目录下,/user/local/software/jdk-8...

  • Mac的linux安装tomcat

    一、Linux下JDK的安装配置 1.安装tomcat前首先要安装对应的jdk并配置Java环境。JDK下载[ht...

  • 配置jdk

    linux配置java环境变量(详细)一. 解压安装jdk在shell终端下进入jdk-6u14-linux-i5...

  • Linux配置jdk环境

    Linux配置jdk环境 下载Linux版本的jdk安装包官网地址 创建一个文件夹jdk(名字随意) 将安装包解压...

  • Linux 配置JDK

    第一步:安装配置JDK环境 建立安装文件夹/home/java 安装下载好的rpm包 下载新版本的JDK 官方地址...

网友评论

    本文标题:linux 配置jdk

    本文链接:https://www.haomeiwen.com/subject/lrrtiftx.html