After upgrading to Yosemite, I was unable to run Apache Solr as it could not find a version of Java installed.
$java -version
No Java runtime present, requesting install.
I downloaded and installed the latest version of Java 8, but that didn’t work. I removed it and downloaded the latest version of Java 7. Â Still no dice.
After a bit of digging around, I found a reference to installing Java for OS X 2014-001. While this is Java 6, it fixed my issue and allowed me to start Solr.
Same problem. I pointed my PATH at Java 8 from my ~/.bashrc with
JAVA_HOME=”/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home”
PATH=$JAVA_HOME/bin:$PATH
Cleared things up for me.
I found that on 10.10 some things didn’t see the Java 8 runtime, but they do see the SDK.
Try the Java 8 SDK. Probably safer than an old Java 6 runtime.
I changed the JRE by the JDK (jdk-8u25-x64-macosx). Everything is working fine now.
Better:
export JAVA_HOME=”$(/usr/libexec/java_home)”
See also:
/usr/libexec/java_home –help