JavaAndMacOS

How do I know what Java version is installed?

Apple distributes JDK 5 and JDK 6 for Mac OS. JDK 5 is pre-installed if you are running Mac OS 10.5.x. You can install and update the JDK via Software Update or download the installer from the Apple site.

To install JDK 6 you must have a 64-bit machine and be running Mac OS 10.5.4 or newer. See 32And64BitMacOS to see if your machine is 32-bit or 64-bit.


To check the Java version

  1. Open Terminal
  2. Type java -version

The Terminal window will display the current default Java version.

If JDK 6 is installed but it is not appearing in the Terminal window as the Java version, you may need to set the default Java version in the Java Preferences. To set the default Java version for applications and applets, open Applications > Utilities > Java > Java Preferences.

You may also need to set the JAVA_HOME environment variable to point explicitly to the JDK location.

To check the environment variables

  1. Open Terminal
  2. Type env

For more on setting the environment variable, see MacOSXEnvForApp

For more information about Java on Mac OS, see http://developer.apple.com/java/
\



\ For more documentation about using NetBeans on Mac OS X, see NetBeansMacOSX

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo