我是 JAVA 和 AppEngine 的新手。我已经安装了JDK-1.6,但仍然出现异常。项目文件部署在服务器上没有任何错误,但是当打开链接时,它会出错。在我的应用程序日志中,它只显示一个异常,即“unsupportefclassversionerror”。我已经安装了 JDK-1.6,但它不工作。我还安装了 JDK-1.5,但在部署阶段它给出了“All Permutation not compiled”错误。我的项目 XML 文件如下
XML 文件是
网页.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee">
<!-- Servlets -->
<servlet>
<servlet-name>greetServlet</servlet-name>
<servlet-class>com.google.mystorage.server.GreetingServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>greetServlet</servlet-name>
<url-pattern>/mystorage/greet</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
appengine-web.xml
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>cloudisapp</application>
<version>2</version>
<!--
By default, App Engine sends requests serially to a given web server.
To allow App Engine to send multiple requests in parallel specify:
<threadsafe>true</threadsafe>
-->
<!-- Configure serving/caching of GWT files -->
<static-files>
<include path="**" />
<include path="favicon.ico"/>
<!-- The following line requires App Engine 1.3.2 SDK -->
<include path="**.nocache.*" expiration="0s" />
<include path="**.cache.*" expiration="365d" />
<exclude path="**.gwt.rpc" />
</static-files>
<!-- Configure java.util.logging -->
<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>
<sessions-enabled>true</sessions-enabled>
</appengine-web-app>
数据存储-indexes.xml
<?xml version="1.0" encoding="UTF-8"?>
<datastore-indexes autoGenerate="true">
</datastore-indexes>
请帮帮我
最佳答案
您为 Java 6 无法理解的 Java 7 进行了编译。
使用 Java 6 javac 重新编译。
关于java.lang.UnsupportedClassVersionError : com/google/mystorage/server/GreetingServiceImpl : Unsupported major. 次要版本 51.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8568083/