macos 上的 java 1.8:找不到 tools.jar

问题描述 投票:0回答:1

我在MacOs上安装了java 8 jdk

 /usr/libexec/java_home -V | grep jdk

Matching Java Virtual Machines (1):
    1.8.411.09 (arm64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home

已安装!

在 android studio 中构建 flutter(旧的!)应用程序时,我得到了这个

* What went wrong:
Execution failed for task ':firebase_messaging:compileDebugJavaWithJavac'.
> Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.

我该怎么办?

我的文件夹

ls -la

% ls -la
total 56
drwxr-xr-x  13 root  wheel   416 13 Mar 08:24 .
drwxr-xr-x  10 root  wheel   320 27 Mag 10:13 ..
-rw-r--r--   1 root  wheel  3245 13 Mar 08:23 COPYRIGHT
-rw-r--r--   1 root  wheel    44 13 Mar 08:23 LICENSE
-rw-r--r--   1 root  wheel    46 13 Mar 08:23 README
-rw-r--r--   1 root  wheel   190 13 Mar 08:23 THIRDPARTYLICENSEREADME-JAVAFX.txt
-rw-r--r--   1 root  wheel   190 13 Mar 08:23 THIRDPARTYLICENSEREADME.txt
-rw-r--r--   1 root  wheel   955 13 Mar 08:23 Welcome.html
drwxr-xr-x  17 root  wheel   544 27 Mag 10:13 bin
drwxr-xr-x   4 root  wheel   128 13 Mar 08:24 legal
drwxr-xr-x  99 root  wheel  3168 13 Mar 08:46 lib
drwxr-xr-x   5 root  wheel   160 13 Mar 08:24 man
-rw-r--r--   1 root  wheel   168 13 Mar 08:23 release

这是

bin
子文件夹

的列表
% ls -la
total 3688
drwxr-xr-x  17 root  wheel     544 27 Mag 10:13 .
drwxr-xr-x  13 root  wheel     416 13 Mar 08:24 ..
lrwxr-xr-x   1 root  wheel       8 27 Mag 10:13 ControlPanel -> jcontrol
-rwxr-xr-x   1 root  wheel  174672 13 Mar 08:41 _javaws
-rwxr-xr-x   1 root  wheel  154080 13 Mar 08:41 java
lrwxr-xr-x   1 root  wheel      47 27 Mag 10:13 javaws -> /Library/Application Support/Oracle/Java/javaws
-rwxr-xr-x   1 root  wheel    3972 13 Mar 08:24 jcontrol
-rwxr-xr-x   1 root  wheel  154032 13 Mar 08:42 jjs
-rwxr-xr-x   1 root  wheel  154048 13 Mar 08:42 keytool
-rwxr-xr-x   1 root  wheel  154048 13 Mar 08:42 orbd
-rwxr-xr-x   1 root  wheel  154048 13 Mar 08:42 pack200
-rwxr-xr-x   1 root  wheel  154048 13 Mar 08:42 policytool
-rwxr-xr-x   1 root  wheel  154048 13 Mar 08:41 rmid
-rwxr-xr-x   1 root  wheel  154048 13 Mar 08:41 rmiregistry
-rwxr-xr-x   1 root  wheel  154048 13 Mar 08:41 servertool
-rwxr-xr-x   1 root  wheel  154048 13 Mar 08:42 tnameserv
-rwxr-xr-x   1 root  wheel  150208 13 Mar 08:41 unpack200
java macos
1个回答
0
投票

1.8.0 JDK 上的tools.jar 文件位于jdk1.8.0/lib/tools.jar。如果找不到,那么你的JDK没有正确安装。

© www.soinside.com 2019 - 2024. All rights reserved.