- 10 JDK 8 Installation for OS X
- System Requirements
- JDK Installation Instructions
- Determining the Default Version of the JDK
- Uninstalling the JDK
- Uninstall jdk mac os
- Determining the Default JDK Version on macOS
- Installing the JDK on macOS
- Uninstalling the JDK on macOS
- Installation FAQ on macOS Platform
- Uninstall jdk mac os
- Determining the Default JDK Version on macOS
- Installing the JDK on macOS
- Uninstalling the JDK on macOS
- Installation FAQ on macOS Platform
- How To Install / Uninstall Multiple Java Versions In Mac OS By Home Brew Or Manually
- 1. Use HomeBrew To Install & Uninstall Java On Mac OS X.
- 1.1 Use HomeBrew Cask Command To Install Java JDK.
- 1.2 Use HomeBrew Cask Command To UnInstall JDK.
- 2. Install & Uninstall JDK In Mac OS Manually.
- 2.1 Install JDK Manually In Mac OS X.
- 2.2 Uninstall Java JDK Manually In Mac OS X.
- 3. Set JAVA_HOME & PATH System Environment Variable.
- 4. Question & Answer.
- 4.1 How to manage multiple JDK versions on mac OS X use SDKMAN .
10 JDK 8 Installation for OS X
This page describes how to install and uninstall JDK 8 for OS X computers.
This page has these topics:
See «JDK 8 and JRE 8 Installation Start Here» for general information about installing JDK 8 and JRE 8.
See «OS X Platform Install FAQ» for general information about installing JDK 8 on OS X.
System Requirements
Observe the following requirements:
Any Intel-based computer running OS X 10.8 (Mountain Lion) or later.
Note that installing the JDK on OS X is performed on a system wide basis, for all users, and administrator privileges are required. You cannot install Java for a single user.
Installing the JDK also installs the JRE. The one exception is that the system will not replace the current JRE with a lower version. To install a lower version of the JRE, first uninstall the current version as described in «Uninstalling the JRE».
JDK Installation Instructions
When you install the Java Development Kit (JDK), the associated Java Runtime Environment (JRE) is installed at the same time. The JavaFX SDK and Runtime are also installed and integrated into the standard JDK directory structure.
Depending on your processor, the downloaded file has one of the following names:
jdk-8u version -macosx-amd64.dmg
jdk-8u version -macosx-x64.dmg
Where version is 6 or later.
Download the file.
Before the file can be downloaded, you must accept the license agreement.
From either the Downloads window of the browser, or from the file browser, double click the .dmg file to launch it.
A Finder window appears containing an icon of an open box and the name of the .pkg file.
Double click the package icon to launch the Install app.
The Install app displays the Introduction window.
In some cases, a Destination Select window appears. This is a bug, as there is only one option available. If you see this window, select Install for all users of this computer to enable the Continue button.
The Installation Type window appears.
A window appears that says «Installer is trying to install new software. Type your password to allow this.»
Enter the Administrator login and password and click Install Software.
The software is installed and a confirmation window appears.
After the software is installed, delete the .dmg file if you want to save disk space.
Determining the Default Version of the JDK
If you have not yet installed Apple’s Java OS X 2012-006 update, then you are still using a version of Apple Java 6 that includes the plug-in and the Java Preferences app. See «Note for Users of OS X that Include Apple Java 6 Plug-in».
There can be multiple JDKs installed on a system, as many as you wish.
When launching a Java application through the command line, the system uses the default JDK. It is possible for the version of the JRE to be different than the version of the JDK.
You can determine which version of the JDK is the default by typing java -version in a Terminal window. If the installed version is 8u6, you will see a string that includes the text 1.8.0_06. For example:
To run a different version of Java, either specify the full path, or use the java_home tool:
For more information, see the java_home(1) man page.
Uninstalling the JDK
To uninstall the JDK, you must have Administrator privileges and execute the remove command either as root or by using the sudo(8) tool.
Navigate to /Library/Java/JavaVirtualMachines and remove the directory whose name matches the following format: Foot1
For example, to uninstall 8u6:
Do not attempt to uninstall Java by removing the Java tools from /usr/bin . This directory is part of the system software and any changes will be reset by Apple the next time you perform an update of the OS.
Footnote1:The 7u4 and 7u5 releases were installed into a directory that does not follow this format. To uninstall 7u4 or 7u5, remove the 1.7.0.jdk directory from the same location.
Contents Previous Next
Источник
Uninstall jdk mac os
The following are the system requirements for installing the JDK on macOS:
Any Intel-based computer running macOS.
You cannot install Java for a single user. Installing the JDK on macOS is performed on a systemwide basis for all users. Administrator privileges are required to install the JDK on macOS.
Determining the Default JDK Version on macOS
When starting a Java application through the command line, the system uses the default JDK.
You can determine which version of the JDK is the default by entering java -version in a Terminal window. If the installed version is 15 Interim 0, Update 0, and Patch 0, then you see a string that includes the text 15 . For example:
To run a different version of Java, either specify the full path, or use the java_home tool. For example:
$ /usr/libexec/java_home -v 15 —exec javac -version
Installing the JDK on macOS
- Download the JDK .dmg file, jdk- 15 . interim.update.patch _osx-x64_bin.dmg from Java SE Downloads page.
Click Accept License Agreement .
Uninstalling the JDK on macOS
Do not attempt to uninstall Java by removing the Java tools from /usr/bin . This directory is part of the system software and any changes will be reset by Apple the next time that you perform an update of the OS.
- Go to /Library/Java/JavaVirtualMachines .
- Remove the directory whose name matches the following format by executing the rm command as a root user or by using the sudo tool:
For example, to uninstall 15 Interim 0 Update 0 Patch 0:
$ rm -rf jdk- 15 .jdk
Installation FAQ on macOS Platform
This topic provides answers for the following frequently asked questions about installing JDK on macOS computers.
1. How do I find out which version of Java is the system default?
When you run a Java application from the command line, it uses the default JDK. If you do not develop Java applications, then you do not need to worry about this. See Determining the Default JDK Version on macOS.
2. How do I uninstall Java?
3. After installing Java for macOS 2012-006, can I continue to use Apple’s Java 6 alongside the macOS JDK for Java 15 ?
If you want to continue to develop with Java 6 using command-line, then you can modify the startup script for your favorite command environment. For bash, use this:
$ export JAVA_HOME=`/usr/libexec/java_home -v 14`
Some applications use /usr/bin/java to call Java. After installing Java for macOS 2012-006, /usr/bin/java will find the newest JDK installed, and will use that for all of the Java-related command-line tools in /usr/bin . You may need to modify those applications to find Java 6, or contact the developer for a newer version of the application.
4. What happened to the Java Preferences app in Application Utilities?
The Java Preferences app was part of the Apple Java installation and is not used by Oracle Java. Therefore, macOS releases from Apple that do not include Apple Java will not include Java Preferences.
Источник
Uninstall jdk mac os
The following are the system requirements for installing the JDK on macOS:
Any Intel-based computer running macOS.
You cannot install Java for a single user. Installing the JDK on macOS is performed on a systemwide basis for all users. Administrator privileges are required to install the JDK on macOS.
Determining the Default JDK Version on macOS
When starting a Java application through the command line, the system uses the default JDK.
You can determine which version of the JDK is the default by entering java -version in a Terminal window. If the installed version is 16 Interim 0, Update 0, and Patch 0, then you see a string that includes the text 16 . For example:
To run a different version of Java, either specify the full path, or use the java_home tool. For example:
$ /usr/libexec/java_home -v 16 —exec javac -version
Installing the JDK on macOS
- Download the JDK .dmg file, jdk- 16 . interim.update.patch _osx-x64_bin.dmg from Java SE Downloads page.
Click Accept License Agreement .
Uninstalling the JDK on macOS
Do not attempt to uninstall Java by removing the Java tools from /usr/bin . This directory is part of the system software and any changes will be reset by Apple the next time that you perform an update of the OS.
- Go to /Library/Java/JavaVirtualMachines .
- Remove the directory whose name matches the following format by executing the rm command as a root user or by using the sudo tool:
For example, to uninstall 16 Interim 0 Update 0 Patch 0:
$ rm -rf jdk- 16 .jdk
Installation FAQ on macOS Platform
This topic provides answers for the following frequently asked questions about installing JDK on macOS computers.
1. How do I find out which version of Java is the system default?
When you run a Java application from the command line, it uses the default JDK. If you do not develop Java applications, then you do not need to worry about this. See Determining the Default JDK Version on macOS.
2. How do I uninstall Java?
3. After installing Java for macOS 2012-006, can I continue to use Apple’s Java 6 alongside the macOS JDK for Java 16 ?
If you want to continue to develop with Java 6 using command-line, then you can modify the startup script for your favorite command environment. For bash, use this:
$ export JAVA_HOME=`/usr/libexec/java_home -v 16`
Some applications use /usr/bin/java to call Java. After installing Java for macOS 2012-006, /usr/bin/java will find the newest JDK installed, and will use that for all of the Java-related command-line tools in /usr/bin . You may need to modify those applications to find Java 6, or contact the developer for a newer version of the application.
4. What happened to the Java Preferences app in Application Utilities?
The Java Preferences app was part of the Apple Java installation and is not used by Oracle Java. Therefore, macOS releases from Apple that do not include Apple Java will not include Java Preferences.
Источник
How To Install / Uninstall Multiple Java Versions In Mac OS By Home Brew Or Manually
This article will tell you how to install/uninstall multiple java versions on mac os both use homebrew or manually. It also shows you how to set JAVA_HOME & PATH system environment variable to make your installed JDK as the default JDK. We recommend you to use homebrew because it provides a lot of easy-to-use tools.
1. Use HomeBrew To Install & Uninstall Java On Mac OS X.
1.1 Use HomeBrew Cask Command To Install Java JDK.
- Install HomeBrew on your mac os, please read the article How To Install HomeBrew On Mac OS.
- Run the below command to install the homebrew cask extension, cask extension tool can help you to install and manage software packages easily.
- Run brew search java or brew search jdk command to find your desired java or JDK version. Below is the search result for the command brew search java .
Below is the search result for the command brew search jdk .
Now install the JDK version that you need like below. During the installation process, you may encounter some error messages like Error: Cask ‘java8’ is unavailable: No Cask with this name exists or Error: Cask adoptopenjdk8 exists in multiple taps.
1.2 Use HomeBrew Cask Command To UnInstall JDK.
- Run homebrew cask command $ brew cask uninstall java to uninstall open JDK 12.0.1. If you want to uninstall open JDK 8 then run $ brew cask uninstall caskroom/versions/adoptopenjdk8 .
Below command uninstall open JDK 12.0.1.
Below command uninstall open JDK 8.
During the above JDK uninstall process, you may encounter the below error, Error: Cask adoptopenjdk8 exists in multiple taps. This is because you should uninstall caskroom/versions/adoptopenjdk8 instead of adoptopenjdk8.
2. Install & Uninstall JDK In Mac OS Manually.
2.1 Install JDK Manually In Mac OS X.
- Download related JDK from oracle JDK download page. You should have an oracle account to log in before the download start.
- Double click the downloaded dmg file to install JDK, just follow the wizard to install it.
- When the installation complete, you can find the JDK install directory in folder /Library/Java/JavaVirtualMachines/. From the below output, we can see there are three JDK that has been installed, one ( adoptopenjdk-8.jdk ) is installed with homebrew, the other two ( jdk-12.0.1.jdk, jdk1.8.0_211.jdk ) are installed by download installation file from oracle.
2.2 Uninstall Java JDK Manually In Mac OS X.
Follow oracle’s documents, to manually uninstall installed JDK in mac os x, you just need to remove some files with root permission in the terminal like below.
-
- Open a terminal and run the below command to remove the java JDK installed directory.
- Run the below command to remove the java control panel if exist.
- Remove java applet plugins.
- Remove java application support.
- Remove the java updater list.
-
- Remove the java helper tool.
3. Set JAVA_HOME & PATH System Environment Variable.
Now we have known how to install/uninstall multiple java JDK versions on mac os. But after that, you need to set JAVA_HOME & PATH environment variable value to set your installed JDK as default JDK. So that you can use it easily.
- Run the below command in a terminal to go to the user home directory.
- Run $ vim .bash_profile command to open .bash_profile file to edit.
- Press esc then press i to enter insert mode and insert the below export command in .bash_profile file.
- Press esc then :wq! to save the above changes and quit the vim editor.
- Run $ source .bash_profile command to make the above changes take effect.
- Now run $ java -version , you can see the new JDK version is used by output info.
4. Question & Answer.
4.1 How to manage multiple JDK versions on mac OS X use SDKMAN .
- My macOS is Catalina Version 10.15.7, and I run the command /usr/libexec/java_home -verbose to find all the installed JDK versions. I installed JDK 12.0.1 and OpenJDK 1.8.0.
Now I want to install and manage more other JDK versions in it, how to manage the multiple JDK versions, thanks.
You can switch to use one JDK with the command $ sdk use java java-identifier .
Источник