android nullable jar,java – 导入NotNull或Nullable,Android Studio将无法编译

当我为参数添加@NotNull或@Nullable注释Android Studio自动帮助我添加/lib/annotations.jar和导入

import org.jetbrains.annotations.NotNull

import org.jetbrains.annotations.Nullable;

但是在这之后,项目将无法编译。如果我也删除注释,但保留import语句,项目仍然无法编译。但如果我删除的NotNull和Nullable的import语句项目编译精细!

Android Studio会显示一般错误:

Gradle:

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':Bugtester:compileDebug'.

> Compilation failed; see the compiler error output for details.

* Try:

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

运行gradlew compileDebug从cmd提供了一点提示:

:Bugtester:compileDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':Bugtester:compileDebug'.

> Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.

* 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 (x86)\Java\jre7

JDK_HOME=C:\Program Files\Java\jdk1.7.0_21\

任何人都有这个想法吗? (我是新和java和android编程)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值