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:~#
  • 相关阅读:
    ios 常用的数学函数
    iOS已发布应用中对异常信息捕获和处理
    iOS 制作framework步骤
    iOS 静态库和动态库.a和framework
    C#实现发送和接收pop3邮件方法
    C#实现给手机发送短信
    C#DataTable DataSet DataRow区别详解
    gridview合并相同的行
    ASP.NET导出EXCEl方法使用EXCEl对象
    ASP.NET导出EXCEl方法使用COM.EXCEL不使用EXCEl对象
  • 原文地址:https://www.cnblogs.com/liujiaxin2018/p/15435114.html
Copyright © 2011-2022 走看看