如何将Java 9添加到Android Studio? [英] How to add Java 9 to Android Studio?

查看:425
本文介绍了如何将Java 9添加到Android Studio?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Robolectric库,该库的最新版本v4.3.1需要Java 9才能运行.我试图将JRE指向编辑配置,但是即使已经安装了Java 9,也无法在下拉列表中找到Java 9.如果有人可以解释的话,那将真的很有帮助!

I am using Robolectric library and the latest version of it v4.3.1 requires Java 9 to run. I am trying to point JRE on edit configurations but I am not finding Java 9 in the drop-down even though I have already installed it. It would be really helpful if somebody can please explain!

请检查已安装Java 9.

Please check Java 9 installed.

推荐答案

在Android Studio中运行Robolectric测试的唯一解决方法是更改​​测试任务的JRE.

The only workaround to run Robolectric test in the Android Studio is to change JRE for the test task.

选择IDE菜单,运行->编辑配置,然后将选项从图片更改为JDK9的位置:

Select IDE menu Run -> Edit Configuration and then change the option from the picture to the location of JDK9:

这篇关于如何将Java 9添加到Android Studio?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆