Macにneo4jをインストール
$ brew info neo4j neo4j: stable community-1.9.3-unix, devel community-2.0.0-M05-unix http://neo4j.org /usr/local/Cellar/neo4j/community-2.0.0-M05-unix (1650 files, 58M) * Built from source From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/neo4j.rb $ brew install --devel neo4j
しかし、起動しない
$ neo4j start WARNING! You are using an unsupported Java runtime. Please use Oracle(R) Java(TM) Runtime Environment 7. 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 [15852]... waiting for server to be ready. Failed to start within 120 seconds. Neo4j Server may have failed to start, please check the logs.
ログをみる
$ cat /usr/local/Cellar/neo4j/community-2.0.0-M05-unix/libexec/data/log/console.log /usr/local/bin/neo4j: line 199: /Library/Internet: No such file or directory /usr/local/bin/neo4j: line 199: /Library/Internet: No such file or directory
なんのこっちゃ、ということでneo4jをみる
vim /usr/local/bin/neo4j 196 else 197 checkwriteaccess 198 echo "WARNING: not changing user" 199 $JAVACMD -cp "${CLASSPATH}" $JAVA_OPTS \ 200 -Dneo4j.home="${NEO4J_HOME}" -Dneo4j.instance="${NEO4J_INSTANCE}" \ 201 -Dfile.encoding=UTF-8 \ 202 org.neo4j.server.Bootstrapper >> "${CONSOLE_LOG}" 2>&1 & echo $! > "${PID_FILE}" 203 fi
$JAVACMDで問題が起きてそう。/Library/Internet Plug-Insはあるので Internetの後のスペースが問題になっていそう。
そういえば、Macの標準のjavaが6で7を使いたかったから前にどっか設定変えたな。
詳細をつめるべく/usr/local/bin/neo4jはbashということでログ出しながら実行。
$ bash -x /usr/local/bin/neo4j start >& /tmp/log.txt
色々あってJDK7のインストールからやることに。java実行環境JREじゃなくてjava開発環境JDKをいれとけ、ということに行き着いた。
http://www.oracle.com/technetwork/java/javase/downloads/index.html
$ /usr/libexec/java_home /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home # ~/.bash_profileなど適切な場所に $ vim ~/.zshrc.mine export JAVA_HOME=`/usr/libexec/java_home` $ source ~/.zshrc
macのjava周りの環境はぐぐってもよくわからない。
上手くいった
$ 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 [436]... waiting for server to be ready........ OK. Go to http://localhost:7474/webadmin/ for administration interface.