Given the following project pom.xml:
 
<?xml version="1.0" encoding="UTF-8"?><project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>Ack</groupId>
  <artifactId>Ack</artifactId>
  <version>0.0.1</version>
  <description></description>
      <dependencies>
        <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.5.0</version>
          <scope>system</scope>
          <systemPath>${java.home}/../lib/tools.jar</systemPath>
        </dependency>
      </dependencies>
</project>
 
Most of our developers have no problems. Some few, however, have been seeing an error in the M2 console  with a missing artifact. It appeared we had traced it down to the Installed JRE preference, which was pointing to a JRE (not JDK) directory. No problem, we should just be able to point to the JDK, right? So we changed the Installed JRE preference to a JDK, still can't resolve. Stop and restart Eclipse, still can't resolve. Change the JAVA_HOME environment variable to the JDK, stop and restart Eclipse, still can't resolve. By changing the systemPath to a junk.jar file, we were able to finally determine that the ${java.home} is apparently still referring to the old JRE location, despite our best efforts to point it elsewhere.
 
It seems like this would be an Eclipse issue, but since we've done what I thought would be required in Eclipse, I have to ask: is there something in the m2Eclipse plugin that is causing it run against the old JRE? Any other ideas on how to run against the correct JDK Java home?
 
Chris Hilton

Reply via email to