在命令行上gradle

时间:2018-03-13 11:47:31

标签: java android illegalargumentexception gradlew

我正在尝试通过命令行上的gradlew执行我的espresso测试。构建保持失败,并显示以下错误。

我输入了以下命令

  

gradlew test --stacktrace --info

显示以下错误:

  

无法从'9.0.4'确定java版本。*尝试:   使用--debug选项运行以获取更多日志输出。   *例外情况是:   java.lang.IllegalArgumentException:无法从'9.0.4'确定java版本。           在org.gradle.api.JavaVersion.toVersion(JavaVersion.java:72)           在org.gradle.api.JavaVersion.current(JavaVersion.java:82)           at org.gradle.internal.jvm.UnsupportedJavaRuntimeException.assertUsingVersion(UnsupportedJavaRuntimeException.java:29)           在org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:32)           在org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)           在org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)           在org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)           在org.gradle.launcher.cli.CommandLineActionFactory $ WithLogging.execute(CommandLineActionFactory.java:253)           在org.gradle.launcher.cli.CommandLineActionFactory $ WithLogging.execute(CommandLineActionFactory.java:182)           在org.gradle.launcher.Main.doAction(Main.java:33)           在org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)           at java.base / jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)           在java.base / jdk.internal.reflect.NativeMethodAccessorImpl.invoke(未知来源)           at java.base / jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)           在java.base / java.lang.reflect.Method.invoke(未知来源)           在org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)           在org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)           在org.gradle.launcher.GradleMain.main(GradleMain.java:23)           at java.base / jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)           在java.base / jdk.internal.reflect.NativeMethodAccessorImpl.invoke(未知来源)           at java.base / jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)           在java.base / java.lang.reflect.Method.invoke(未知来源)           在org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)           在org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)           在org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)引用

可能的解决方案是什么?

0 个答案:

没有答案