I'm studying Cypher for Neo4j, and tried the very simple example in the documentation https://github.com/neo4j/neo4j/blob/2.0.1/community/cypher/cypher-docs/src/test/java/org/neo4j/cypher/javacompat/JavaQuery.java
I'm having a java.lang.IncompatibleClassChangeError due to the ExecutionEngine. My full code is
GraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase(DatabaseConstants.MyDB);
try( Transaction tx = db.beginTx() ) {
Node myNode = db.createNode();
myNode.setProperty("name", "My node");
tx.success();
}
System.out.println(scala.util.Properties.versionString());
ExecutionEngine engine = new ExecutionEngine(db);
db.shutdown();
and the complete output is
version 2.9.0.1
Exception in thread "main" java.lang.IncompatibleClassChangeError: class scala.reflect.ManifestFactory$$anon$6 has interface scala.reflect.AnyValManifest as super class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at scala.reflect.ManifestFactory$.<init>(Manifest.scala:88)
at scala.reflect.ManifestFactory$.<clinit>(Manifest.scala)
at org.neo4j.cypher.ExecutionEngine.createCorrectCompiler(ExecutionEngine.scala:126)
at org.neo4j.cypher.ExecutionEngine.<init>(ExecutionEngine.scala:37)
at org.neo4j.cypher.javacompat.ExecutionEngine.<init>(ExecutionEngine.java:53)
at org.neo4j.cypher.javacompat.ExecutionEngine.<init>(ExecutionEngine.java:43)
at neo4j.tutorials.NeoCypherQuery.run(NeoCypherQuery.java:24)
at neo4j.tutorials.NeoCypherQuery.main(NeoCypherQuery.java:13)
In particular, I don't understand why the scala version is the 2.9.0.1, while I have in the project classpath the scala-library-2.10.3.jar, included in the downloaded file.
I'm running on
- Mac Os X Maverick 10.9,
- Neo4j 2.0.1 Enterprise Edition
- Java 1.7.0_45 HotSpot Server
- I also have Scala 2.10.4 installed in my system.
Does anybody have a suggestion? Thank you very much