📜  linux install java jre 命令行 - Shell-Bash (1)

📅  最后修改于: 2023-12-03 15:02:42.261000             🧑  作者: Mango

Linux Install Java JRE Command Line - Shell/Bash

Java is a popular programming language used by developers to create various types of applications and software. In order to run Java applications, you need to have Java Runtime Environment (JRE) installed on your system.

This guide will provide instructions on how to install Java JRE on Linux using the command line in Shell/Bash.

Prerequisites
  • A Linux system
  • sudo or root access
Steps to Install Java JRE
  1. To get started, open your Linux terminal.

  2. Update the package list and upgrade the packages on your system using the following command:

    sudo apt update && sudo apt upgrade
    
  3. Once the packages are updated, install Java JRE using the following command:

    sudo apt install default-jre
    
  4. After the installation is complete, verify that Java JRE is installed by checking the version using the following command:

    java -version
    

    This command will display the installed version of Java JRE on your system.

    openjdk version "11.0.9.1" 2020-11-04
    OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04)
    OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)
    

    If the command is not recognized, try logging out and logging back in or opening a new terminal window.

Conclusion

Congratulations! You have successfully installed Java JRE on Linux using the command line in Shell/Bash. You can now start running Java applications on your Linux system.