Android Lint-失败:生成失败,出现异常

Android Lint-失败:生成失败,出现异常,android,lint,gradlew,Android,Lint,Gradlew,我想在我的项目上运行gradlew:lint 但是,我得到了错误: C:\[ProjectName]>gradlew :lint Starting a Gradle Daemon, 1 incompatible and 3 stopped Daemons could not be reused, use --status for details Incremental java compilation is an incubating feature. FAILURE: Build fa

我想在我的项目上运行
gradlew:lint

但是,我得到了错误:

C:\[ProjectName]>gradlew :lint
Starting a Gradle Daemon, 1 incompatible and 3 stopped Daemons could not be reused, use --status for details
Incremental java compilation is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
Task 'lint' not found in root project '[ProjectName]'. Some candidates are: 'init'.

* Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 27.334 secs
当我运行时:
gradlew lint

我得到错误

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
我无法在线搜索任何解决方案

参考:


将JAVA_HOME变量设置为
C:\Program Files\JAVA\jdkX.XX
对我很有效

由于某种原因,它以前被设置为JRE目录

将JAVA_HOME变量设置为
C:\Program Files\JAVA\jdkX.XX

1) 转到搜索栏并键入“环境”,然后单击“编辑系统环境变量”。 2) 点击“环境变量”按钮 3) 在系统变量标题下,单击“新建”。输入名称为
JAVA_HOME
,然后像Jeffrey说的那样查找jdk的路径。单击确定,然后再次单击确定


echo%JAVA\u HOME%
在DOS窗口上运行
gradlew lint
without:当我使用
gradlew lint
发布错误时,我收到了不同的错误,因为这是正确的语法