Ok, the solution was to run Eclipse with
-Djava.home="C:\Program Files\Java\jdk1.5.0_11\jre"

Dont't know if this will break other projects, will have to investigate some more.


On 22.2.2007 16:32, Borut Bolčina wrote:
Now I see it! There is an entry:

java.home=C:\Program Files\Java\jre1.5.0_11

which is jre and therefore doesn't have tools.jar. How to convince Eclipse to point to C:\Program Files\Java\jdk1.5.0_11?

But then...the

<systemPath>${java.home}/../lib/tools.jar</systemPath>

suggests that java.home in Eclipse should be

java.home=C:\Program Files\Java\jdk1.5.0_11\jre

to correctly locate tools.jar.


On 22.2.2007 16:20, Chris Hilton wrote:
Go to Help->About Eclipse SDK->Configuration Details. See what the java.home property there is set to and report back. Please.
 
Chris


From: Borut Bolčina [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 22 February, 2007 09:14
To: [email protected]
Subject: [m2eclipse-user] Won't compile because of transitive dependency not finding its artifact

My project builds ok in command line, but in Eclipse with 0.0.10 I can not get rid of

22.2.07 16:00:44 CET: Missing:
1) com.sun:tools:jar:1.5.0
  Try downloading the file manually from the project website.
  Then, install it using the command:
      mvn install:install-file -DgroupId=com.sun -DartifactId=tools \
          -Dversion=1.5.0 -Dpackaging=jar -Dfile=/path/to/file
  Path to dependency:
      1) com.interseek:feed-index-server:jar:1.1.5
      2) org.htmlparser:htmlparser:jar:1.6
      3) com.sun:tools:jar:1.5.0
1 required artifact is missing.
for artifact:
  com.interseek:feed-index-server:jar:1.1.5
from the specified remote repositories:
  central (http://repo1.maven.org/maven2)


At first I thought the artifact is really missing but it is not. Then I discovered one of my project's dependency

        <dependency>
            <groupId>org.htmlparser</groupId>
            <artifactId>htmlparser</artifactId>
            <version>1.6</version>
        </dependency>

is itself dependent on

        <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.5.0</version>
          <scope>system</scope>
          <systemPath>${java.home}/../lib/tools.jar</systemPath>
        </dependency>

I have put an ant task in my pom to display the ${java.home} just to be sure where it is pointing

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>echohome</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <echo>JAVA_HOME=${java.home}</echo>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

It prints

[INFO] [antrun:run {execution: echohome}]
     [echo] JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11\jre

I have set the system user variable JAVA_HOME to both
  • C:\Program Files\Java\jdk1.5.0_11\jre
  • C:\Program Files\Java\jdk1.5.0_11
and none of them helps getting rid of red error icon on my project's pom.xml which is well-formed and valid.

Any help appreciated,
Borut


--
bbLOG

--
bbLOG

Reply via email to