今日build项目报错:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':floatingactionmenu:compileDebugJava'.
> 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
说JDK有问题。我运行别的项目都没问题,到这里就有问题了!?
秉承着尊重报错信息的原则,双击了shift(Android Studio中搜索东西用的),输入了JDK,找到了一个Switch IDE Boot JDK的选项,那就更改一下吧,选择了系统中的JDK路径,然后提示重启软件。
接着问题就来了,启动直接报错,说找不到JDK,然后Android Studio界面就进不去喽,想改都没得改喽。
方法还是有的:
进入Android Studio安装目录下,进入bin,找到一个叫studio.bat的Windows批处理文件,右键编辑一下,里面有一行
SET JDK=
把Android Studio目录下的jre目录填在后边:SET JDK=D:\AndroidStudio\jre,保存,运行这个studio.bat,可以进入Studio界面了。
赶紧在Studio界面里把JDK路径改回来,还是双击shift搜索,然后把studio.bat里自己加的东西删掉。
一切又回到了熟悉的模样。