Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Java
  3. Question
Java

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

Asked by Jordan Duncan Oct 6, 2022 2.3K views 2 answers
Share

About this question

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!!

Your answer

2 Answers

Ranjana Admin JanBask Expert Latest answer

Answered on Jun 3, 2024

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

Was this helpful?

More Java discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Java Blogs

Guides, tips and career advice on Java from JanBask experts.