I received an error - no java runtime present, requesting to install. What should I do?

1.1K    Asked by JordanDuncan in Java , Asked on Oct 6, 2022

Even though JRE 8 is installed on my MAC OS Yosemite 10.10.3,while running the Android present in tools in sdk - the error - " No Java Runtime present, requesting to install " gets displayed in terminal- how do I solve this issue?

I wanted to install Xamarin test recorder - after installing they asked me to install Android sdk SDK is downloaded in Library/Developer/Xamarin/android-sdk Now when I run Android present in tools folder - I get the error - No Java runtime I've installed JRE 8 with get the verified java version from their site Can someone please help!!

Answered by Jordan PARKER

This worked for me to resolve the error - no java runtime present, requesting to install on macOS high sierra. Did not install JDK.


Go to terminal:

vim ~/.bash_profile

add export JAVA_HOME=/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home

Save and close it.

. ~/.bash_profile

java -version

You should be able to see java version



Your Answer

Answer (1)

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:

  1. Go to the AdoptOpenJDK website.
  2. Download the installer for the latest LTS version (e.g., OpenJDK 11 or OpenJDK 17).
  3. 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

5 Months

Interviews

Parent Categories