gpt4 book ai didi

java - 将 Google App Engine 应用程序 (Java) 导入 Eclipse

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:33:51 24 4
gpt4 key购买 nike

首先:我不确定它是否适合这样的问题,所以如果您认为有更多合适的空间,请移动它。

我有一些基于 GAE 的项目需要导入到 Eclipse 中。我下载了新版本的 Eclipse EE (Kepler) 并安装了 App Engine 插件。然后我从源代码创建了一个新项目并尝试配置它......这就是问题开始的地方。

当我尝试构建项目时出现 3 个错误:

The App Engine SDK '\incap-ii\build\web\WEB-INF\lib\appengine-api-1.0-sdk-1.8.0.jar' on the project's build path is not valid (SDK directory 'D:\incap-ii\build\web\WEB-INF\lib\appengine-api-1.0-sdk-1.8.0.jar' does not exist)    incap-ii        Unknown Google App Engine Problem
Project 'incap-ii' is missing required library: 'war/WEB-INF/lib/jsr107cache-1.1.jar' incap-ii Build path Build Path Problem
The project cannot be built until build path errors are resolved incap-ii Unknown Java Problem

第一个错误说找不到一些 jar 文件,但显示的路径很奇怪。实际上它缺少指向工作区的部分 (D:\workspaces\eclipse GAE\) - 休息,从 incap-ii 开始就可以了。我尝试配置构建路径或更改 SDK 路径:

config

如您所见,我在配置中有 2 个 SDK。但是,我无法更改此项目中使用的那个:我从列表中选择 appengine-java-1.8.5 - 1.8.5,单击“确定”,对话框窗口关闭但错误仍然存​​在,一旦我再次打开对话框,我就会看到更改未保存(仍然使用错误的)。

是否有某些我应该更改的特定配置?

[编辑]一些更多的解释/屏幕(如下)。正如您在屏幕 1 中所见,我 (preferences\google\appengine) 我已经配置了 2 个 appEgines:一个是我手动下载和提取的(在屏幕上选中),另一个是通过 Google App Engine 插件下载的。无论如何,当我现在检查项目首选项时,我看到 3 个引擎(屏幕 2)- 另一个(已选择)在项目目录中。正如我所说,我无法更改它,因为在我单击“确定”后,更改不会保存。但是,当我打开“配置 SDK”(屏幕 3)时,我只能看到两个外部引擎。我勒个去?我试图重新安装整个 Eclipse,但它没有帮助......另外,当我使用 Netbeans 构建它并从 shell 运行时,我能够使用手动下载的 AppEngine 运行这个项目,所以引擎可能没问题......

  1. > enter image description here
  2. > enter image description here
  3. > enter image description here

最佳答案

我遇到的一个问题可能和你的一样。就我而言,Eclipse 说:

The App Engine SDK 'C:\Users\Takahiko.m2\repository\com\google\appengine\appengine-api-1.0-sdk\1.8.8\appengine-api-1.0-sdk-1.8.8.jar' on the project's build path is not valid (SDK location 'C:\Users\Takahiko.m2\repository\com\google\appengine\appengine-api-1.0-sdk\1.8.8\appengine-api-1.0-sdk-1.8.8.jar' is not a directory)

这意味着 Eclipse 在搜索 App Engine SDK 安装目录之前在本地 Maven 存储库 (~/.m2/repository) 中找到了 App Engine SDK 二进制文件。

(1) 在 Eclipse 中关闭您的项目

(2) 使用文本编辑器打开项目的 .classpath,如果它包含与 App Engine 相关的类路径,如下所示:

<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/shared/appengine-local-runtime-shared.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/shared/el-api.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/shared/jsp/repackaged-appengine-ant-1.7.1.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/shared/jsp/repackaged-appengine-ant-launcher-1.7.1.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/shared/jsp/repackaged-appengine-jasper-6.0.29.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/shared/jsp/repackaged-appengine-jasper-el-6.0.29.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/shared/jsp/repackaged-appengine-tomcat-juli-6.0.29.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/shared/jsp-api.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/shared/servlet-api.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/appengine-tools-api.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/opt/user/appengine-api-labs/v1/appengine-api-labs.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/opt/user/appengine-endpoints/v1/appengine-endpoints-deps.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/opt/user/appengine-endpoints/v1/appengine-endpoints.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/opt/user/datanucleus/v2/asm-4.0.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/opt/user/datanucleus/v2/datanucleus-api-jdo-3.1.3.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/opt/user/datanucleus/v2/datanucleus-api-jpa-3.1.3.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/opt/user/datanucleus/v2/datanucleus-appengine-2.1.2.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/opt/user/datanucleus/v2/datanucleus-core-3.1.3.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/opt/user/datanucleus/v2/geronimo-jpa_2.0_spec-1.0.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/opt/user/datanucleus/v2/jdo-api-3.0.1.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/opt/user/datanucleus/v2/jta-1.1.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/opt/user/jsr107/v1/appengine-jsr107cache-1.8.8.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/opt/user/jsr107/v1/jsr107cache-1.1.jar">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/lib/user/appengine-api-1.0-sdk-1.8.8.jar" sourcepath="C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/src/user/appengine-api-1.0-sdk-1.8.8-src.zip">
<attributes>
<attribute name="javadoc_location" value="file:/C:/Eclipse/eclipse-juno/plugins/com.google.appengine.eclipse.sdkbundle_1.8.8/appengine-java-sdk-1.8.8/docs/javadoc/"/>
</attributes>
</classpathentry>

(3) 删除所有 classpathentry 的(与 App Engine jar 文件相关)。

(4) 添加 GAE_CONTAINER MAVEN2_CLASSPATH_CONTAINER 之前。

<classpathentry kind="con" path="com.google.appengine.eclipse.core.GAE_CONTAINER"/>

(5) 重新打开您的项目

关于java - 将 Google App Engine 应用程序 (Java) 导入 Eclipse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19194272/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com