在使用mac打包Android时遇到 Could not find tools.jar. Please check that ... ,原因是由于Mac OSX最近更新了,由10.x升到12.3.1
解决步骤:
1. 查看 JDK 位置的命令
/usr/libexec/java_home -V 执行这个命令可能看到两个路径,一个是 JDK 的实际路径,另一个是JRE路径
~ /usr/libexec/java_home -V
Matching Java Virtual Machines (2):
1.8.121.13 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
1.8.0_121 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
2. 手动复制 tools.jar
将/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/tools.jar 复制到 /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib
|