Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Solving Problems in Neo4j Shell and Neo4j Desktop

DZone's Guide to

Solving Problems in Neo4j Shell and Neo4j Desktop

· Java Zone
Free Resource

Microservices! They are everywhere, or at least, the term is. When should you use a microservice architecture? What factors should be considered when making that decision? Do the benefits outweigh the costs? Why is everyone so excited about them, anyway?  Brought to you in partnership with IBM.

I’ve been playing around with Neo4j on a Windows VM recently and I wanted to launch neo4j-shell to run a few queries.

The neo4j-shell script isn’t shipped with Neo4j desktop which I used to install Neo4j on my VM but we can still launch it from the Windows Command Prompt with the following command:

C:\Users\Mark> cd "C:\Program Files\Neo4j Community"
C:\Program Files\Neo4j Community>jre\bin\java -cp bin\neo4j-desktop-2.0.0-RC1.jar org.neo4j.shell.StartClient
 
Welcome to the Neo4j Shell! Enter 'help' for a list of commands
NOTE: Remote Neo4j graph database service 'shell' at port 1337
Want bash-like features? throw in jLine (http://jline.sourceforge.net) on the classpath

Unfortunately if we start typing in a query we don’t get any feedback as to what we’ve typed, although if we type something syntactically valid and suffix it with a semi colon and press enter it will be evaluated!

e.g. this is the output from entering the following query

START n = node(*) RETURN COUNT(n);
2013 11 29 16 53 56

The reason for the problem is to do with the ‘.shell_history’ file that the shell tries to write to the directory it’s launched from. In this case we don’t have permission to write anything to ‘C:\Program Files\Neo4j Community’ and so we get no feedback.

To work around this problem we need to start the command prompt as an administrator which we can do from the apps menu by right clicking the ‘Command Prompt’ icon:

2013 11 29 17 00 59

Next we click ‘Start as Administrator’ and click through the next screen:

2013 11 29 17 01 14

Now if we launch neo4j-shell and type in our query we get the expected feedback:

2013 11 29 17 04 26


Discover how the Watson team is further developing SDKs in Java, Node.js, Python, iOS, and Android to access these services and make programming easy. Brought to you in partnership with IBM.

Topics:

Published at DZone with permission of Mark Needham, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}