The problem is that with the update the built-in java took precedence and it doesn’t have the SDK because it’s just the runtime.
Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation
You just need to change your java home and add the java binary to your .zshrc to find your java home execute:
/usr/libexec/java_home -V | grep jdk
the output should be similar to the following:
Matching Java Virtual Machines (1): 1.8.0_272 (x86_64) "AdoptOpenJDK" - "AdoptOpenJDK 8" /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
you should take the path from the one that says SDK in my case
after that, you just add the following to the end of your .zshrc that should be in your home.
You can edit it with (if you decide to use vim you can exit writing :wq! and pressing enter)
add the following:
export JAVA_HOME=the/path/you/copied/before export PATH=$JAVA_HOME/bin:$PATH
where the/path/you/copied/before in my case would be
save the file and close all your terminals and open them again.
If while editing .zshrc file getting error “.zshrc” E212: Can’t open file for writing then use sudo vim.zshrc and you’ll be able to edit.
The error should be solved.
In my case:
I used the command
/usr/libexec/java_home -V | grep jdk Cristian Gomez provided, got two paths:
Matching Java Virtual Machines (2): 126.96.36.199 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home 1.8.0_111 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home
.zshrc did not solve the problem.
Finally I copied
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/ and solved the problem.
I don’t know if this approach will lead to any unknown problems.