Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google app engine return error log: unsupported major.minor version 51.0

I've just build a sample application to test out google app engine and google web toolkit feature, using a RPC service and google app engine with JDO. The service works on local. But after i deploy it to GAE and run, it show me the error as title says. I use JRE7 to complie the application. Here is my error log:

Uncaught exception from servlet
java.lang.UnsupportedClassVersionError: com/gwt/myexample/server/EmployeeServiceImpl:
Unsupported major.minor version 51.0
at com.google.appengine.runtime.Request.process-e8c21a25e91f709f(Request.java)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
   (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.mortbay.util.Loader.loadClass(Loader.java:91)
at org.mortbay.util.Loader.loadClass(Loader.java:71)
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext
 (TraceContext.java:449)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run
 (TraceContext.java:455)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.
 runInInheritedContextNoUnref(TraceContext.java:333)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.
 runInInheritedContext(TraceContext.java:325)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
at java.lang.Thread.run(Thread.java:679)

My application link: http://jdodemo02.appspot.com/ Any suggestion please ):

like image 422
ducnh Avatar asked Mar 31 '12 10:03

ducnh


4 Answers

Compile your application with Java SE 6. GAE doesn't support Java SE 7. Locally it works, because the GAE simulator runs on top of your local JDK.

like image 169
Arjan Tijms Avatar answered Oct 22 '22 21:10

Arjan Tijms


One thing is to set the JRE 6 to the Build Path and the Compiler as well. Dont forget, once you created your GAE Web Application project with a different JRE or JDK, always check the java version in the org.eclipse.wst.common.project.facet.core.xml in your .settings folder.

like image 45
Alex M Avatar answered Oct 22 '22 20:10

Alex M


instead of directly editing the org.eclipse.wst.common.project.facet.core.xml in your .settings folder It will be better review it in eclipse as bellow

Right click on your eclipse project

Select Properties

Select "Project Facets" in the left panel

Select the Java version appropriately

enter image description here

like image 22
Fahad Avatar answered Oct 22 '22 20:10

Fahad


I've been fighting for days. I have a Mac and needed to use GCM developing an Android app. The only way I could get GAE working in Android Studio, and also compatible with the installed JVM that I had was:

  • Install Homebrew.
  • Customize it with Homebrew Cask (brew install caskroom/cask/brew-cask).
  • Install Java using homebrew cask (brew cask install java).
  • Install Android Studio using homebrew cask (brew cask install android-studio).
  • Update Studio to the latest version.
  • Go to settings of the project in Studio and change the target JDK to the one that homebrew installed (1.8 located in /Library/Java/Home, which is actually a symlink).

Hope non of you guys run in the same path as I did, One just doesn't walk into Mordor, It has been 5 long days of fighting.

like image 37
Rudolf Real Avatar answered Oct 22 '22 21:10

Rudolf Real