0
votes

I am just starting out with Neo4j and this is my first stackoverflow question!

I tried to run the Hello-World example in Eclipse with the user library of Neo4j. ( https://github.com/neo4j/neo4j/blob/2.2.2/community/embedded-examples/src/main/java/org/neo4j/examples/EmbeddedNeo4j.java)

I only changed the DB_PATH='data/graph.db' ( because in my neo4j-server.properties :org.neo4j.server.database.location=data/graph.db)

The output I got in the console is:

Hello, brave Neo4j World! Shutting down database ...

I shut down the neo4j server using /etc/init.d/neo4j-service stop, then ran eclipse and got the output as provided above.I started the neo4j server again and checked localhost:7474 through the browser. There were no rows added to the database.

Is there an error in my DB_PATH? I even tried neoeclipse but did not get any output.

1

1 Answers

0
votes

That example creates and then deletes the data so that is one reason why your graph is empty.

Another observation is your DB_PATH. If you've set DB_PATH='data/graph.db', then that path is relative to your project path. If your code is located in /projects/example then this embedded database should be created in /projects/example/data/graph.db

If that's the case, then the Neo4j server which is configured to look for the database as org.neo4j.server.database.location=data/graph.db will look for data/graph.db relative to your neo4j installation.

So you can either fix the path in your code (full path to the db), or change the path in neo4j-server.properties