Recently need to use neo4j to do a small test, seemingly a smooth installation but when the server started the error. Finally found the problem is JDK1.7 installation, less modified a symlink.
My installation steps are as follows:
JDK1.7 was downloaded from Oracle and Java_home variables were modified in ~/.BASHRC.
The code is as follows |
Copy Code |
Export Java_home=/usr/libexec/java_home-v 1.7 |
Checked the current JDK version.
The code is as follows |
Copy Code |
> Source ~/.BASHRC > java-version Java Version "1.7.0_25" Java (TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot (TM) 64-bit Server VM (build 23.25-b01, Mixed mode) |
There seems to be no problem, but it's not actually done.
Under/system/library/frameworks/javavm.framework/versions there is a currentjdk symlink that still points to the path to JDK 1.6.
If the symlink is not modified, the neo4j startup times are wrong.
code is as follows |
copy code |
> neo4j Start Using additional JVM arguments: -server-xx:+disableexplicitgc-dorg.neo4j.server.properties=conf/ Neo4j-server.properties -djava.util.logging.config.file=conf/logging.properties-dlog4j.configuration=file: Conf/log4j.properties -xx:+useconcmarksweepgc-xx:+cmsclassunloadingenabled-dneo4j.ext.udc.source=homebrew Starting neo4j Server ... Warning:not changing user Process [29976] ... waiting for server to be ready .... Failed to start within seconds. Neo4j Server may have failed to start, please check the logs. |
You need to execute the command:
The code is as follows |
Copy Code |
> cd/system/library/frameworks/javavm.framework/versions > sudo rm currentjdk > sudo ln-s/library/java/javavirtualmachines/jdk1.7.0_25.jdk/contents/currentjdk > Ls-l CURRENTJDK Lrwxr-xr-x 1 root wheel Aug 01:58 currentjdk->/library/java/javavirtualmachines/jdk1.7.0_25.jdk/contents/ |
Then
code is as follows |
copy code |
> neo4j Start Using additional JVM arguments: -server-xx:+disableexplicitgc-dorg.neo4j.server.properties=conf/ Neo4j-server.properties -djava.util.logging.config.file=conf/logging.properties-dlog4j.configuration=file: Conf/log4j.properties -xx:+useconcmarksweepgc-xx:+cmsclassunloadingenabled-dneo4j.ext.udc.source=homebrew Starting neo4j Server ... Warning:not changing user Process [33636] ... waiting for server to be ready ..... Ok. Go to Http://localhost:7474/webadmin/for administration interface. neo4j Server |
The
starts successfully. On the internet to see a lot of people reported similar mistakes, but the reason is not all the JDK path problem caused.