简体   繁体   中英

How to install Java 8 runtime environment on OS X Mountain Lion

I am running OS X 10.6.5. I want to use the current JRE because some software I would like to use depends on it (not browser applications). I downloaded the installer from Oracle (jre-8u60-macosx-x64.dmg), and ran it with administrator privileges.

The software depending on Java does not launch.

There is only this one version of Java installed, per the Java Control Panel.

When I type java -version in Terminal, I get the following error output:

No Java runtime present, requesting install. 2015-09-03 12:43:15.675 java[1091:303] JLRequestRuntimeInstall: Error calling: CFMessagePortCreateRemote

A few dozen searches have failed to turn up useful insights for me.

What am I doing incorrectly, or misunderstanding?

When you install a JDK (development kit), it's assumed that as a programmer, you'll be using the command line tools. But the standalone JRE is considered a tool that's used by GUI-installed software, and that the software that needs it will know where to find it.

Nevertheless, it's possible to run the java command-line tool from Terminal, either by using the full path:

$ '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java' ClassName

Or by adding it to the shell path in .bashrc in your home directory:

export PATH="$PATH:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin"

And then, after you open a new terminal (already-open terminals are not affected by changes to .bashrc ), you can just type java .

The quotes are needed in the above commands, because there is a space in the path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM