Explain Codes LogoExplain Codes Logo

Installing Java on OS X 10.9 (Mavericks)

java
installation
java-home
symbolic-links
Nikita BarsukovbyNikita Barsukov·Sep 25, 2024
TLDR

To swiftly install Java on OS X 10.9, follow these steps:

  1. Download the Java JDK from Oracle's official site.
  2. Open the downloaded .dmg file and follow the intuitive installation instructions.
  3. Verify the installation with the java -version command in Terminal.

That's it! Java is now installed and ready to conquer Mavericks.

Fixing common installation issues

Let's squash some frequent bugbears during Java installation:

"No Java runtime present" error

Are you getting nightmares with the "No Java runtime present, requesting install" error showing up after a fresh OS installation? Breathtakingly simple solution: download and install "Java for OS X 2014-001" from Apple's support website. The update included in this install will supersede any lingering previous versions and banish this bug.

Setting JAVA_HOME

Consider the JAVA_HOME environment variable as your North Star in the vast Java cosmos. Point it towards /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home for JRE or to the JDK installation directory typically located under /Library/Java/JavaVirtualMachines/jdk<version>.jdk/Contents/Home and it will guide tools to Java's current location. Set it permanently by pasting the below command into your .bashrc or .zshrc file. Don't worry, Mac won't throw any tantrums!

# "JAVA_HOME, I choose you!" Who wouldn't love Pokemon, right? export JAVA_HOME=$(/usr/libexec/java_home)

Create symbolic links between JDK and the JavaVM framework's CurrentJDK section. The ln -nsf command, with the assistance of the known-to-all sudo command, can work this out for you, convincing applications that they are dealing with familiar territory.

Eclipse or IntelliJ IDEA compatibility

When using Eclipse or IntelliJ IDEA, make sure to download Oracle's JDK 7 or a newer version. This will let you escape the clutches of annoying Java SE 6 runtime prompts. Not just this, upgrade IntelliJ IDEA's plist to reflect the new JVM version if you are using it as JVMVersion=1.8*.

Advanced installation - Pro Tips and Tricks

Escaping installation prompts

To escape Apple's monotonous JDK installation prompts, create a symbolic link to your preferred JDK version. Et voila, no more annoying interruptions!

JAVA_HOME and PATH magic

For smooth command-line operations, add your JAVA_HOME to the PATH environment variable. This ensures that the system knows where to find Java's magic tools.

# "Sudo make me a sandwich." Who needs magic when you have sudo, right? export PATH=$JAVA_HOME/bin:$PATH

Checking installed versions

For final assurance, check the installed Java and Java compiler versions by reigning in the Terminal with java -version and javac -version commands.