简体   繁体   English

Google应用引擎部署:JDK而非JRE

[英]Google app engine deployment : JDK not JRE

I have the 我有

java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE.

While deploying my application on google app engine, I have searched for solutions and found that i should add: -vm C:\\Program Files\\Java\\jdk1.7.0_02\\bin\\javaw.exe to eclipse.ini file to force eclipse to use JDK not JRE, I have confirmed from windows >> prefrences >> java >>> installed JRE that it points to the JDK not the JRE ... I tried uninstalling the whole jdk and installing it again ... and I still have the problem .... 在google app引擎上部署我的应用程序时,我搜索了解决方案,发现我应该添加: -vm C:\\ Program Files \\ Java \\ jdk1.7.0_02 \\ bin \\ javaw.exeeclipse.ini文件中以强制eclipse到使用JDK而不是JRE,我已经从Windows >>偏好>> Java >>>安装的JRE中确认它指向JDK而不是JRE ...我尝试卸载整个jdk并再次安装...但我仍然有问题 ....

eclipse.ini file is: eclipse.ini文件是:

-vm C:\Program Files\Java\jdk1.7.0_02\bin\javaw.exe
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20140116-2212
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx512m

and from Help >> About Eclipse >>>Installation details >>>configuration: I have this: 并从帮助>>关于Eclipse >>>安装详细信息>>>配置:我有这个:

-startup
F:\programs\some\eclipse-jee-kepler-SR2-win32\eclipse\\plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.appendVmargs
-vm C:\Program Files\Java\jdk1.7.0_02\bin\javaw.exe
-product
org.eclipse.epp.package.jee.product
-vm
C:\Program Files (x86)\Java\jre7\bin\client\jvm.dll
eclipse.home.location=file:/F:/programs/some/eclipse-jee-kepler-SR2-win32/eclipse/
eclipse.launcher=F:\programs\some\eclipse-jee-kepler-SR2-win32\eclipse\eclipse.exe
eclipse.launcher.name=Eclipse
eclipse.p2.data.area=@config.dir/../p2/

JAVA_HOME variable value: C:\\Program Files\\Java\\jdk1.7.0_02\\bin JAVA_HOME变量值: C:\\ Program Files \\ Java \\ jdk1.7.0_02 \\ bin

In eclipse.ini write this (note : you have to add new line after -vm) 在eclipse.ini中编写此代码(注意:您必须在-vm之后添加新行)

-vm 
C:\Program Files\Java\jdk1.7.0_02\bin

I tried this and worked. 我尝试了这个并且工作了。 First of all I am using GAE 1.9.2 and Eclipse Luna. 首先,我使用GAE 1.9.2和Eclipse Luna。 Luna too need jdk 1.7. Luna也需要jdk 1.7。 From command prompt mention JAVA_HOME and path. 在命令提示符下提及JAVA_HOME和路径。 Use normal JAVA_HOME and PATH command to jdk version. 使用普通的JAVA_HOME和PATH命令到jdk版本。 There after from console run eclipse. 从控制台运行Eclipse之后。 In eclipse set preferred JDK in preferences to jdk 1.7 在Eclipse中,将首选JDK设置为优先于jdk 1.7

And it will work. 它将起作用。

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

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