So you just upgraded your Mac (probably to Yosemite) and now you are getting annoying browser errors that say “To view this web content you need to install the Java Runtime Environment.” More annoyingly, after clicking through to Oracle’s Java.com to “Download Java for Mac OS X” and installing it, you still get the error! To install Java on MacOS you need to go to the official Oracle download page and click on the major version of Java (currently the newest version is Java SE 11.0.2 LTS).Accept a license agreement and click on jdk-9.0.4osx-x64bin.dmg. When downloading is finished launch dmg file and double-click on.
To install Java on MacOS you need to go to the official Oracle download page and click on the major version of Java.
Press “JDK Download” link and scroll down and download macOS Installer.
When downloading is finished launch dmg file and double-click on the icon.
Java installer welcome page will be opened.
So Java is successfully installed and ready to use.
To check Java version you need:
- Open Launchpad
- Find and open Terminal
- Type java -version
Java(TM)SE Runtime Environment(build9.0.1+11)
Java HotSpot(TM)64-Bit Server VM(build9.0.1+11,mixed mode)
Mac Install Jdk
Trying to run a Java application on your Mac and need to set your JAVA_HOME? Follow the instructions below to quickly and easily do it:
- Open Terminal
- Confirm you have JDK by typing “which java”. It should show something like /usr/bin/java.
- Check you have the needed version of Java, by typing “java -version”.
- JAVA_HOME is essentially the full path of the directory that contains a sub-directory named bin which in turn contains the java.
- For Mac OSX – it is /Library/Java/Home
- Set JAVA_HOME using this command in Terminal: export JAVA_HOME=/Library/Java/Home
- echo $JAVA_HOME on Terminal to confirm the path
- You should now be able to run your application
Note that this sets JAVA_HOME only for this session. If you want it to persist, you will have to add the command to your ~/.profile file. Below are instructions on how to accomplish this instead:
- Open up Terminal.app (Applications >> Utilities >> Terminal)
- Type: emacs .profile
- add this to the end of the .profile file:
- Save and exit emacs (ctrl-x, ctrl-s; ctrl-x, ctrl-c)
- Open a new Terminal window (cmd-n) and type: $JAVA_HOME/bin/java -version
How To Install Java For My Mac
If you see something like:
java version “1.5.0_16″
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)
Java Application Install
Then you’ve successfully set your JAVA_HOME environment variable to the binary stored in /Library/Java/Home/bin/java