简体   繁体   English

Google App Engine部署错误:JDK不是JRE

[英]Google app engine deployment error : JDK not JRE

I'm trying to deploy the app with a .jsp file, which I figured is the reason I get an error because other projects without .jsp files have no problem. 我正在尝试使用.jsp文件部署应用程序,我认为这是出现错误的原因,因为其他没有.jsp文件的项目都没有问题。

When I try to deploy the app, I get the error : "Cannot get the System Java Compiler. Please use a JDK, not a JRE" 尝试部署应用程序时,出现错误:“无法获取System Java编译器。请使用JDK,而不是JRE”。

I tried resolving the problem using Mahmoud's solution here : Google app engine deployment : JDK not JRE 我尝试在此处使用Mahmoud的解决方案解决该问题: Google应用引擎部署:JDK而非JRE

But once I have changed the eclipse.ini file, I launch Eclipse and get this error : "Version 1.7.0_80 of the JVM is not suitable for this product. Version 1.8 or greater is required" 但是,一旦更改了eclipse.ini文件,便会启动Eclipse并收到以下错误消息:“ JVM版本1.7.0_80不适合该产品。需要版本1.8或更高版本”

You need to install JDK8 or JRE8 for Eclipse to execute and JDK7 for compile this application to build. 您需要安装用于Eclipse的JDK8或JRE8才能执行,并需要安装JDK7来编译此应用程序。

As mentioned in the error, JDK7 is not compatible with Eclipse. 如错误中所述,JDK7与Eclipse不兼容。 So you need to set your system JDK to 8 for Eclipse. 因此,您需要将Eclipse的系统JDK设置为8。 Alternatively, you could instead modify the environment variables or startup script for Eclipse to reference JDK8 and avoid making this a system wide change. 或者,您可以改为修改Eclipse的环境变量或启动脚本,以引用JDK8,并避免在系统范围内进行更改。

Although for security purposes, I do recommend using the latest JDK/JRE as the system one for most cases. 尽管出于安全性考虑,我还是建议在大多数情况下使用最新的JDK / JRE作为系统之一。

Then within Eclipse, set the project JDK to 7. 然后在Eclipse中,将项目JDK设置为7。

Click through the following: 单击以下内容:

Windows -> Preferences -> Java -> Installed JRE Windows->首选项-> Java->已安装JRE

There you can remove the "JRE System Library", then you can add and configure another already installed JRE/JDK for this specific project. 在那里,您可以删除“ JRE系统库”,然后可以为该特定项目添加和配置另一个已经安装的JRE / JDK。

You need the JDK for building which includes a JRE, but for deploying you only need the JRE. 您需要用于包含JRE的JDK进行构建,但是对于部署,您只需要JRE。

The JDK includes the ability to compile Java source into executable code, where as the JRE can only execute that executable code. JDK包括将Java源代码编译成可执行代码的功能,而JRE只能执行该可执行代码。

You can download JDK from Oracle's site here: Oracle Java JDK 8 您可以从Oracle网站下载JDK: Oracle Java JDK 8

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM