0

As I try to run the application on localhost, I get this exception. Why does it occur. What do I need to do resolve it ?

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/appengine/tools/development/agent/AppEngineDevAgent : Unsupported major.minor version 51.0

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 java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:300)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:358)

FATAL ERROR in native method: processing of -javaagent failed
punita.gosar
  • 400
  • 3
  • 8
saplingPro
  • 20,769
  • 53
  • 137
  • 195
  • possible duplicate of [Unsupported major.minor version 51.0](http://stackoverflow.com/questions/10382929/unsupported-major-minor-version-51-0) – Andrei Volgin Mar 13 '14 at 02:43

2 Answers2

0

JVMs are backwards compatible, not forward. So a Java 6 JVM can run Java 5 compiled bytecode, but not Java 7. This is what's happening in your case.

Latest AppEngine SDKs require your code to be compiled with Java 7 (which you probably do), then apparently you run it under Java 6 JVM.

This usually happens when your IDE runs on Java 6 JVM - check settings.

Peter Knego
  • 79,991
  • 11
  • 123
  • 154
0

The verison of javac and java used have to be same, i.e. the Java version used to compile the code and the one user to run the code have to be same. Check javac and java versions on command prompt.

javac -version
java -version

If you are using an IDE to run your project, check the jdk version in your IDE Preferences.

punita.gosar
  • 400
  • 3
  • 8