user17375
user17375

Reputation: 529

neo4j cannot find JAVA_HOME when checking service status

I installed neo4j 1.8.2 on opensuse 12.2/64. To do so I had to add the JAVA_HOME path in the /etc/profile file as:

export JAVA_HOME=/opt/java/64/jdk1.7.0_21/jre/:
export PATH=$PATH:/opt/java/64/jdk1.7.0_21/jre/bin/;

Now when I try to check the server status I get the following error

>service neo4j-service status

    neo4j-service.service - LSB: The Neo4J graph database server. See http://neo4j.org
              Loaded: loaded (/etc/init.d/neo4j-service)
              Active: failed (Result: exit-code) since Fri, 26 Apr 2013 17:13:56 +0200; 10s ago
             Process: 7234 ExecStart=/etc/init.d/neo4j-service start (code=exited, status=1/FAILURE)
              CGroup: name=systemd:/system/neo4j-service.service

    Apr 26 17:13:56 linux-wwcz neo4j-service[7234]: which: no java in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/...bin)
    Apr 26 17:13:56 linux-wwcz neo4j-service[7234]: Error: JAVA_HOME is not defined correctly.
    Apr 26 17:13:56 linux-wwcz neo4j-service[7234]: We cannot execute

It's quite puzzling considering neo4j-service links to ./bin/neo4j, namely the file used at installation time with

./bin/neo4j install

Some ideas on what is going on here?

Thanks

SOLVED

Actually I was using jdk 7 instead of jdk 6

EDIT 2

According to the official neo4j page one runs the server using neo4j start. But I got into troubles when trying to run service neo4j start/status/stop as suggested in the Installing Neo4j in Linux how-to.

Upvotes: 2

Views: 4103

Answers (2)

ghchoi
ghchoi

Reputation: 5156

Not exactly for the question, but I reached here because I also though Neo4j could not find the environment variable JAVA_HOME when

sudo neo4j start

My problem was that OS reset environment variables when using sudo.

sudo -E neo4j start

solved my problem.

Upvotes: 0

duffymo
duffymo

Reputation: 308763

Try changing them to this:

export JAVA_HOME=/opt/java/64/jdk1.7.0_21/:
export PATH=$PATH:/opt/java/64/jdk1.7.0_21/bin/;

Upvotes: 1

Related Questions