Install Neo4j via Maven

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.

Answer

I solved as follows:

  1. Go to directory: /opt/local/java
  2. Execute “sudo ln -s sun6/lib/”
  3. To verify execute “sudo ls -ld lib”

Now your Maven command will run without problem.
Good luck!

Attribution
Source : Link , Question Author : webjay , Answer Author : Alan Camillo

Leave a Comment