简体   繁体   English

Web应用程序项目中的Eclipse包浏览器错误

[英]Eclipse package explorer error in a web application project

I am following a tutorial by Google on "google app engine using java" and trying to make a simple web application. 我正在遵循Google的“使用Java的Google应用程序引擎”教程,并尝试制作一个简单的Web应用程序。 But I am having problem to make a JSP file in the war directory. 但是我在制作war目录中的JSP文件时遇到问题。 This is the tutorial page: https://developers.google.com/appengine/docs/java/gettingstarted/usingjsps 这是教程页面: https : //developers.google.com/appengine/docs/java/gettingstarted/usingjsps

I am using eclipse. 我正在使用日食。 When I create a new JSP file in the war directory, it causes an error in the package explorar. 当我在war目录中创建新的JSP文件时,它将在软件包explorar中导致错误。 The error is:"Your project must be configured to use a JDK in order to use JSPs" How can I get rid from this error? 错误是:“您的项目必须配置为使用JDK才能使用JSP”如何摆脱该错误?

在“ 窗口”“惯用选项”“ Java”“已安装的JRE”中 ,确保已安装JDK,并将其选择为默认JDK。

First thing, go into Window>Preferences>Installed JREs and sellect a JDK's JRE. 首先,进入“窗口”>“首选项”>“已安装的JRE”并出售JDK的JRE。

Them add this line to eclipse.ini: 他们将此行添加到eclipse.ini中:

-vm C:\Program Files\Java\jdk1.7.0_45\bin\javaw.exe

That line must be in the beginning of the file, before any -vmargs argument, or else Eclipse will crash on start. 该行必须在文件的开头,在任何-vmargs参数之前,否则Eclipse将在启动时崩溃。

Last go into your System's environment variables and add "C:\\Program Files\\Java\\jdk1.7.0_45\\bin" to the PATH variable, before the "%SystemRoot%\\system32" entry. 最后,进入系统的环境变量,并在“%SystemRoot%\\ system32”条目之前,将“ C:\\ Program Files \\ Java \\ jdk1.7.0_45 \\ bin”添加到PATH变量中。

Those three entries must all point to the same JDK and, of course, must be changed to whatever your JDK's path actually is. 这三个条目必须全部指向同一个JDK,并且当然必须更改为您的JDK实际路径。

Restart your Eclipse and you should be good to go. 重新启动Eclipse,您应该一切顺利。

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

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