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:

https://github.com/neo4j/neo4j/blob/master/community/embedded-examples/src/main/java/org/neo4j/examples/embeddedneo4j.java

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

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -