0
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/neo4j/graphdb/RelationshipType : 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)

Now I know from here : How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version that neo4j might be needing a different version of JRE so compile time jre and runtime jre are a mismatch. I tried to change them through project specific settings but none of them worked. I am using 2.0.0 milestone release neo4j-community jars.

Let me know what other information I should provide.

Community
  • 1
  • 1
ajkl
  • 1,016
  • 1
  • 7
  • 27
  • 2
    Basically you need to run with Java 7. You haven't told us anything about how you're trying to run it at the moment. – Jon Skeet Sep 02 '13 at 21:22
  • This is the code I am trying to run https://github.com/neo4j/neo4j/blob/2.0.0-M04/community/embedded-examples/src/main/java/org/neo4j/examples/EmbeddedNeo4j.java – ajkl Sep 02 '13 at 21:22
  • @JonSkeet I am using the above code, and adding the community jars on the build path as a user-library and compiler compliance in eclipse is set to 6.0 – ajkl Sep 02 '13 at 21:24
  • 1
    Neo4J 2.0* only supports Java 7 from now on. – fbiville Sep 03 '13 at 07:49

1 Answers1

3

Worked with updating to java-7-openjdk. Thanks @jon-skeet

ajkl
  • 1,016
  • 1
  • 7
  • 27