What is wrong with my neo4j test setup? EmbeddedNeo4j.java, neo4j, maven -
i started project maven using "quickstart" archetype. changed pom include neo4j:
https://github.com/ence688r/msrcs/blob/master/pom.xml
i added:
and ran
mvn package
this works no errors, but
java -cp target/msrcs-1.0-snapshot.jar org.neo4j.examples.embeddedneo4j
returns error:
exception in thread "main" java.lang.noclassdeffounderror: org/neo4j/graphdb/relationshiptype
what missing? @ point need test can include , use neo4j.
you need add neo4j dependencies classpath well. @ moment you're adding source jar created. if @ pom you'll see neo4j examples require many other dependencies.
find libs directory dependencies have been downloaded (this may in local .m2 maven repo) , add these jars classpath. not need add each jar one-by-one can add directory wildcards - ex:
windows:
java -cp "target/msrcs-1.0-snapshot.jar;lib/*" org.neo4j.examples.embeddedneo4j
mac/unix:
java -cp "target/msrcs-1.0-snapshot.jar:lib/*" org.neo4j.examples.embeddedneo4j
Comments
Post a Comment