Neo4j says I can install Neo4j via Maven by adding it to my build:
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>1.8.1</version>
</dependency>
But do I need a build?
If so, what should my pom.xml
look like?
I tried with this:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.webcom.app</groupId>
<artifactId>webcom</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>webcom</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>1.9.M04</version>
</dependency>
</dependencies>
</project>
But then I end up with:
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] /opt/local/java/sun6/../lib/tools.jar
I have installed sun-jdk6-6.0.26
and set JAVA_HOME
to /opt/local/java/sun6
.
I solved as follows:
Now your Maven command will run without problem. Good luck!
The env var
$JAVA_HOME
should point to the directory containingbin
, so that$JAVA_HOME/bin
containsjavac
. (You probably worked-around a mis-configured env var that might cause other problems later -- e.g., not finding other parts of the JDK)Verify that everything is set up correctly by running:
type javac
(andtype java
) ,javac -version
(andjava -version
). If the wrong version is found, check the path & java_home (always:PATH=$JAVA_HOME/bin:$PATH
)If using eclipse (a common misconfiguration issue), you'll have to configure your jdk via the preferences -> installed jre's (or possibly project->java build path->libraries->JRE System Library->edit->"workspace default JRE")