Mac system upgrade to Big Sur, AS compilation error:
* What went wrong:
Execution failed for task ':xxx:compileReleaseJavaWithJavac'.
> Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.
Copy the code
The JDK updated through Apple software is version 1.6, in /System/Library/Java.
-
Download and install JDK7, after installation directory in/Library/Internet plug-ins/JavaAppletPlugin plugin.
-
In the System the Java folder (/ System/Library/Java/JavaVirtualMachines) establish JDK7 folder (folder name cannot exist space).
-
Copy the Contents from javaappletplugin. plugin(right click – show package Contents) into the newly created folder.
-
To start the terminal, enter:
Touch.bash_profile open-e. bash_profile The system will open the text editor and enter: JAVA_HOME = / System/Library/Java/JavaVirtualMachines / 1.7 JDK/Contents/Home PAHT = $JAVA_HOME/bin: $PAHT export JAVA_HOME Export PATH Saving is disabled. Enter source.bash_profile in terminalCopy the code
For details, see Configuring JDK7 in the Mac OS