1. 先去链接下载jdk or jre(服务器上这个就好)

  2. 然后解压 tar 下载的文件,放到/usr/local/java/jdk_xxx下面

    • -v: 可视化显示进度。 Enables verbose mode, showing the progress of the command
    • -x: 解压。Extract
    • -z: 使用gzip。 Uses gzip, omit this if you just have a .tar
    • -f: 指定文件。 specifies file input, rather than STDIN
    • -C: 指定解压目录
  3. 编辑~/.bash_profile

    • .bash_profile 给bash用的用户级别的。
    • .profile Bourne 用的用户级别的。
    • /etc/profile 系统级别的。有初始化的作用。
  4. 内容

    export JAVA_HOME=/usr/local/java/jdk1.8.0_202
    export PATH=$JAVA_HOME/bin:$PATH
    
  5. source ~/.bash_profile使编辑生效。

  6. 完成

相关文章:

  • 2021-11-03
  • 2021-09-22
  • 2021-10-07
  • 2021-10-17
  • 2021-07-12
  • 2021-11-25
猜你喜欢
  • 2021-09-28
  • 2021-04-28
  • 2021-12-30
  • 2022-12-23
  • 2021-12-05
  • 2021-12-18
  • 2021-07-11
相关资源
相似解决方案