📅  最后修改于: 2023-12-03 14:48:06.639000             🧑  作者: Mango
If you're running Ubuntu and need to install the Java Runtime Environment (JRE), you'll be happy to know that it's a quick and easy process. In this guide, we'll walk you through the steps.
Before we can install the JRE, we need to update our package list to ensure we have the latest available packages.
Open a terminal window (Ctrl+Alt+T) and run the following command:
sudo apt update
Now that we're up to date, we can install the JRE using the following command:
sudo apt install default-jre
This will install the default JRE version that's currently available in the Ubuntu package repository.
Once the installation is complete, you can verify that the JRE is installed and working by running the following command:
java -version
This will display the version of the JRE that's currently installed.
That's it! You now have the JRE installed on your Ubuntu system. If you need a newer or specific version of the JRE, you can check the Ubuntu package repository or download and install it manually. But for most users, the default JRE provided by Ubuntu should work just fine.
sudo apt update
sudo apt install default-jre
java -version