java.lang.UnsupportedClassVersionError: com/google

2019-07-24 14:36发布

i am new to JAVA and AppEngine. I have installed JDK-1.6, but still that exception occurs. Project files are deployed on server without any errors, but when open link, then it gives an error. In my application logs it shows only one exception which is "unsupportefclassversionerror". i have installed JDK-1.6, but its not working. I have also installed JDK-1.5 but at deploying stage it gives "All Permutation not compiled" error. My project XML files are below

XML files are

web.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>



datastore-indexes.xml

<?xml version="1.0" encoding="UTF-8"?>
<datastore-indexes  autoGenerate="true">
</datastore-indexes> 

Please help me

2条回答
仙女界的扛把子
2楼-- · 2019-07-24 15:00

You have compiled for Java 7 which Java 6 cannot understand.

Recompile with a Java 6 javac.

查看更多
成全新的幸福
3楼-- · 2019-07-24 15:00

I had the same problem with a shared project. Try deleting all the compiled classes (everything under the war/WEB-INF/classes directory that looks like the compiled version of your sources).

查看更多
登录 后发表回答