The error "No Java runtime present, requesting to install" indicates that your system does not have a Java Runtime Environment (JRE) installed, or the installed JRE is not properly configured.
Here's how you can resolve this issue:
Step 1: Check for Existing Java Installation
Before installing a new JRE, check if Java is already installed on your system:
Open a terminal or command prompt.
Type the following command and press Enter:
java -version
If Java is installed, this command will display the Java version. If you see an error message, proceed to install Java.
Step 2: Install Java
If Java is not installed, you need to install it. You have a couple of options:
Option A: Install OpenJDK (Open Java Development Kit)
OpenJDK is an open-source implementation of the Java Platform.
On Windows:
- Go to the AdoptOpenJDK website.
- Download the installer for the latest LTS version (e.g., OpenJDK 11 or OpenJDK 17).
- Run the installer and follow the instructions.
On macOS:
Open a terminal.
Use Homebrew to install OpenJDK:
brew install openjdk
After installation, you may need to set the JAVA_HOME environment variable. Add the following line to your ~/.zshrc, ~/.bash_profile, or ~/.profile:
export JAVA_HOME=$(/usr/libexec/java_home)
Then, reload your profile:
source ~/.zshrc # or the appropriate file
On Linux:
Open a terminal.
Use your package manager to install OpenJDK. For example, on Ubuntu:
sudo apt updatesudo apt install openjdk-11-jdk