env.JAVA_HOME undefined
Closed this issue · 6 comments
I was getting these errors while building the project:
[ERROR] The project com.betfair.cougar:cougar-test-utils:3.1-SNAPSHOT (/home/andresp/git/cougar3/cougar-test/cougar-test-utils/pom.xml) has 1 error
[ERROR] 'dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${env.JAVA_HOME}/lib/tools.jar @ line 47, column 16
[ERROR]
[ERROR] The project com.betfair.cougar:cougar-client-code-tests:3.1-SNAPSHOT (/home/andresp/git/cougar3/cougar-test/cougar-client-code-tests/pom.xml) has 1 error
[ERROR] 'dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${env.JAVA_HOME}/lib/tools.jar @ line 127, column 25
replacing ${env.JAVA_HOME} with ${java.home} on the referred lines fixed the problem.
JAVA_HOME is a pretty standard environment variable, we’ve had probe using java.home in the past as sometimes it gets set to the jre. At least this way you can ensure it’s a jdk, so just set it in your environment.
We can add to some building notes when we get round to it ;)
On 9 Jul 2014, at 16:59, André Pinto notifications@github.com wrote:
I was getting these errors while building the project:
[ERROR] The project com.betfair.cougar:cougar-test-utils:3.1-SNAPSHOT (/home/andresp/git/cougar3/cougar-test/cougar-test-utils/pom.xml) has 1 error
[ERROR] 'dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${env.JAVA_HOME}/lib/tools.jar @ line 47, column 16
[ERROR][ERROR] The project com.betfair.cougar:cougar-client-code-tests:3.1-SNAPSHOT (/home/andresp/git/cougar3/cougar-test/cougar-client-code-tests/pom.xml) has 1 error
[ERROR] 'dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${env.JAVA_HOME}/lib/tools.jar @ line 127, column 25replacing ${env.JAVA_HOME} with ${java.home} on the referred lines fixed the problem.
—
Reply to this email directly or view it on GitHub.
I have JAVA_HOME defined as an environment variable. The problem is with ${env.JAVA_HOME}. I don't know why Maven is not picking that environment property on my system, nevertheless the official documentation says we should use ${java.home}:
env.JAVA_HOME
Contains the Java installation directory. This can point to either a Java Development Kit (JDK) installation or a Java Runtime Environment (JRE). Instead of using this, you should consider referencing the ${java.home} property.
in http://books.sonatype.com/mvnref-book/reference/resource-filtering-sect-properties.html
I build the current code just fine on a mac, without any ref to classes.jar, I don't fancy hacking our profiles like that...
As for java.home, once the travis build is passing, submit a pull request and if travis passes then we'll include it.
My intention with the stackoverflow post was just to show a typical configuration for the JDK tools dependency using java.home.
Ah ok
On 10 Jul 2014 14:56, "André Pinto" notifications@github.com wrote:
My intention with the stackoverflow post was just to show a typical
configuration for the JDK tools dependency using java.home.—
Reply to this email directly or view it on GitHub
#76 (comment).