Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

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!

share|improve this answer

The env var $JAVA_HOME should point to the directory containing bin, so that $JAVA_HOME/bin contains javac. (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 (and type java) , javac -version (and java -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")

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.