zoukankan      html  css  js  c++  java
  • ubuntu 中配置java环境(在线软件包)

    1、内核版本

    root@ubuntu02:~# hostnamectl
       Static hostname: ubuntu02
             Icon name: computer-vm
               Chassis: vm
            Machine ID: 3c186d21e7094b71a8889a2d78350c4b
               Boot ID: cc8cf35b8ad54b68a5a2f07eb4042153
        Virtualization: vmware
      Operating System: Ubuntu 20.04.3 LTS
                Kernel: Linux 5.11.0-38-generic
          Architecture: x86-64

    2、测试java

    root@ubuntu02:~# java
    
    Command 'java' not found, but can be installed with:
    
    apt install openjdk-11-jre-headless  # version 11.0.11+9-0ubuntu2~20.04, or
    apt install default-jre              # version 2:1.11-72
    apt install openjdk-13-jre-headless  # version 13.0.7+5-0ubuntu1~20.04
    apt install openjdk-16-jre-headless  # version 16.0.1+9-1~20.04
    apt install openjdk-17-jre-headless  # version 17+35-1~20.04
    apt install openjdk-8-jre-headless   # version 8u292-b10-0ubuntu1~20.04
    root@ubuntu02:~# java --version
    
    Command 'java' not found, but can be installed with:
    
    apt install openjdk-11-jre-headless  # version 11.0.11+9-0ubuntu2~20.04, or
    apt install default-jre              # version 2:1.11-72
    apt install openjdk-13-jre-headless  # version 13.0.7+5-0ubuntu1~20.04
    apt install openjdk-16-jre-headless  # version 16.0.1+9-1~20.04
    apt install openjdk-17-jre-headless  # version 17+35-1~20.04
    apt install openjdk-8-jre-headless   # version 8u292-b10-0ubuntu1~20.04

    3、直接安装

    root@ubuntu02:~# apt install openjdk-11-jre-headless
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following additional packages will be installed:
      ca-certificates-java java-common
    Suggested packages:
      default-jre fonts-dejavu-extra fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei | fonts-wqy-zenhei
    The following NEW packages will be installed:
    …………
    Updating certificates in /etc/ssl/certs...
    0 added, 0 removed; done.
    Running hooks in /etc/ca-certificates/update.d...
    
    done.
    done.

    4、测试效果

    root@ubuntu02:~# java -v  // ?????
    Unrecognized option: -v
    Error: Could not create the Java Virtual Machine.
    Error: A fatal exception has occurred. Program will exit.
    root@ubuntu02:~# java --version
    openjdk 11.0.11 2021-04-20
    OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
    OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
    root@ubuntu02:~#
  • 相关阅读:
    June 26th 2017 Week 26th Monday
    June 25th 2017 Week 26th Sunday
    June 24th 2017 Week 25th Saturday
    June 23rd 2017 Week 25th Friday
    June 22nd 2017 Week 25th Thursday
    2018最佳网页设计:就是要你灵感爆棚!!!
    图片素材类Web原型制作分享-Pexels
    想要打动HR的心,UX设计师求职信究竟应该怎么写?
    【UXPA大赛企业专访】Mockplus:“设计替代开发”将成为现实
    2018年最好的医疗网站设计及配色赏析
  • 原文地址:https://www.cnblogs.com/liujiaxin2018/p/15435114.html
Copyright © 2011-2022 走看看