我有一个简单的 Google App Engine 项目,该项目使用 Java 8 并利用了以前在 GAE 运行 Java7 时受限制的一些类。
在 maven ( mvn appengine:devserver
) 中运行开发服务器成功,并且受限制的类已正确加载。
但是,使用 IntelliJ 应用程序引擎插件运行应用程序会导致旧错误:
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
- 虚拟机选项设置为
-Duse_jetty9_runtime=true -D--enable_all_permissions=true
由于此错误https://github.com/sbt/sbt-appengine/issues/56
最佳答案
虽然 IntelliJ 和所有插件都是最新的,但我刚刚意识到 Google 发布了一个新插件,用于通过 IntelliJ 管理 Google Cloud。 由于该插件是全新的,因此不会自动更新/安装,需要手动安装。
安装新版本已解决问题,开发运行程序现在可以正常工作。
Installation
You can find our plugin in the Jetbrains plugin repository by going to IntelliJ -> Settings -> Browse Repositories, and search for 'Google Cloud Tools'.
https://github.com/GoogleCloudPlatform/google-cloud-intellij#installation
关于google-app-engine - 如何在 Java 8 模式下运行 IntelliJ 的 Google App Engine Dev Server 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52039478/