如何在Java 8模式下运行IntelliJ的Google App Engine开发服务器插件

时间:2018-08-27 12:33:23

标签: google-app-engine intellij-idea java-8 google-cloud-platform intellij-plugin

我有一个简单的Google App Engine项目,该项目使用Java 8,并在GAE运行Java7时使用了一些以前受限制的类。

在maven(mvn appengine:devserver)中运行开发服务器成功运行,并且正确加载了受限制的类。

但是,使用IntelliJ App Engine插件运行以运行该应用程序会导致以下旧错误: Caused by: java.lang.NoClassDefFoundError: java.net.ProxySelector is a restricted class. Please see the Google App Engine developer's guide for more details.

应如何配置插件以正确的Java8模式运行应用程序?


详细信息:

  • Java版本= 1.8.0_151
  • App Engine SDK版本-1.9.64
  • appengine-web.xml设置了<runtime>java8</runtime>
  • IntelliJ版本2018.2.2
  • 由于此错误https://github.com/sbt/sbt-appengine/issues/56,VM选项设置为-Duse_jetty9_runtime=true -D--enable_all_permissions=true

IntelliJ GAE Runner plugin configuration screenshot

1 个答案:

答案 0 :(得分:1)

尽管IntelliJ和所有插件都是最新的,但我才意识到Google发布了一个新插件,用​​于通过IntelliJ管理Google Cloud。 由于该插件是全新的,因此不会自动更新/安装,因此需要手动安装。

安装新版本已解决了这些问题,并且开发人员运行正常。

  

安装

     

您可以转到IntelliJ->设置->浏览存储库,然后搜索“ Google Cloud Tools”,在Jetbrains插件存储库中找到我们的插件。

https://github.com/GoogleCloudPlatform/google-cloud-intellij#installation