Even though JRE 8 is installed on my MAC -" No Java Runtime present,requesting to install " gets displayed in terminal

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?

  1. I wanted to install Xamarin test recorder - after installing they asked me to install Android sdk

  2. SDK is downloaded in Library/Developer/Xamarin/android-sdk

  3. Now when I run Android present in tools folder - I get the error - No Java run time

  4. I've installed JRE 8 with get the verified java version from their site

Can someone please help!!


Solution 1:

You have to install the full JDK, not only the JRE.

I had the same issue and solved by installing JDK.

Please use this link to download the latest JDK version 17.

Solution 2:

I didn't need the full JDK, I just needed to make JRE work and none of the other answers provided above worked for me. Maybe it used to work, but now (1st Jul 2018) it isn't working. I just kept getting the error and the pop-up.

I eventually solved this issue by placing the following JAVA_HOME export in ~/.bash_profile:

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

Hope this helps someone. I'm running Mac OS High Sierra.

Solution 3:

After installing openjdk with brew and runnning brew info openjdk I got this

enter image description here

And from that I got this command here, and after running it I got Java working

sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

Solution 4:

2021 solution

TL;DR

brew install temurin

Details

On an M1 Mac/Apple Silicon (running Big Sur), I had already openjdk installed. As signaled in a previous answer by Mohammed, openjdk is keg-only with brew, and hence requires adding a symlink.

After following this, it solved the No Java Runtime present error, but rJava was complaining about missing libjvm.dylib and that existing libraries were for the wrong architecture:

.onLoad failed in loadNamespace() for 'rJava', details:
  call: dyn.load(jvm, FALSE)
  error: unable to load shared object '/opt/homebrew/Cellar/openjdk/16.0.2/libexec/openjdk.jdk/Contents/Home/lib/server/libjvm.dylib':
  dlopen(/opt/homebrew/Cellar/openjdk/16.0.2/libexec/openjdk.jdk/Contents/Home/lib/server/libjvm.dylib, 10): 
    no suitable image found.  Did find:
    /opt/homebrew/Cellar/openjdk/16.0.2/libexec/openjdk.jdk/Contents/Home/lib/server/libjvm.dylib: 
    mach-o, but wrong architecture

Installing Eclipse Temurin (previously AdoptOpenJDK) (and removing the previously created symlink in /Library/Java/JavaVirtualMachines/openjdk.jdk) immediately solved both issues seamlessly.

Just run brew install temurin and everything should be OK.