How to remove Java 9 on macOS Sierra

I am having trouble uninstalling Java 9from my system macOS Sierra.

I accidentally installed Java 9instead Java 8, so now all my projects Eclipsegive me the following warnings:Build path specifies execution environment JavaSE-1.8. There are no JREs installed in the workspace that are strictly compatible with this environment.

I used the following guide , but it did not work. Here is my command output when starting java -versionfrom the command line:

java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
+4
source share
6 answers

After viewing the Java virtual machines that I had on my computer, run the following command:

ls /Library/Java/JavaVirtualMachines

, Java 8 ( Java 9) JDK. , , SE, -, .

, , , Java SE Development Kit 8.

+1

macOS high sierra java 9: ​​

java, , :

/usr/libexec/java_home -V

"" finder ,

+11

, . , JAVA_HOME , .

export JAVA_HOME =/Library/Java/JavaVirtualMachines/jdk1.8.0_ (, ).jdk//

→ JAVA_HOME =/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk//

Else / jdk .

sudo rm -rf/Library/Java/JavaVirtualMachines/jdk- (, ).jdk/

→ sudo rm -rf/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/

. github → https://gist.github.com/schnell18/bcb9833f725be22f6acd01f94b486392

+4

MacOS , JDK :

/usr/libexec/java_home -V

JDK, , :

/usr/libexec/java_home -v 1.8

, java -version.

JRE Eclipse Preferences/Java/Installed JREs, "", -V . , , .

+2

Oracle Java :

. Java, remove root, sudo. ( ) :

Click on the Finder icon located in your dock
Click on the Utilities folder
Double-click on the Terminal icon
In the Terminal window Copy and Paste the commands below:
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -fr ~/Library/Application\ Support/Java

Java, Java /usr/bin. , reset Apple , .

: https://www.java.com/en/

+1

, , java-. , , , Java.

- SDKMan, , Java.

: http://sdkman.io/

Java :

$ sdk install java

, Scala:

$ sdk install scala 2.12.1

:

$ sdk uninstall java 9

. , .

0

Source: https://habr.com/ru/post/1691074/


All Articles