There are a lot of updates on Java versions recently, and it is hard to keep track of them. In this post, I will show you a tip to manage and install different Java versions on MacOS Mojave 10.14+.
- The
Desktop
class allows interact with various desktop capabilities.Supported operations include:- launching the user-default browser to show a specified URI;
- launching the user-default mail client with an optional
mailto
URI; - launching a registered application to open, edit or print a specified file.
This class provides methods corresponding to these operations. The methods look for the associated application registered on the current platform, and launch it to handle a URI or file. If there is no associated application or the associated application fails to be launched, an exception is thrown. Please seeDesktop.Action
for the full list of supported operations and capabilities.An application is registered to a URI or file type. The mechanism of registering, accessing, and launching the associated application is platform-dependent.Each operation is an action type represented by theDesktop.Action
class.Note: when some action is invoked and the associated application is executed, it will be executed on the same system as the one on which the Java application was launched.- Since:
- 1.6
- See Also:
Desktop.Action
The following are the system requirements for installing the JDK and the JRE on macOS:
- Any Intel-based computer running macOS.
- Administrator privileges.You cannot install Java for a single user. Installing the JDK and JRE on macOS is performed on a systemwide basis for all users. Administrator privileges are required to install the JDK and JRE on macOS.
- When you install the JDK, it also installs the JRE. However, the system will not replace the current JRE with a lower version.To determine the current JRE version installed on your system, see Determining the JRE Version Installed on macOS. To install an earlier version of the JRE, you must first uninstall the current version. See Uninstalling the JRE on macOS.
- When you install the JRE, you can install only one JRE on your system at a time. The system will not install a JRE that has an earlier version than the current version.To determine the current JRE version installed on your system, see Determining the JRE Version Installed on macOS. To install an earlier version of the JRE, you must first uninstall the current version. See Uninstalling the JRE on macOS.Note:Installing a JRE from Oracle will not update
java -version
symlinks or addjava
to your path. To do this, you must install the JDK.