betfair / cougar

Cougar is a framework for making building network exposed service interfaces easy.
http://betfair.github.io/cougar
Apache License 2.0
27 stars 18 forks source link

env.JAVA_HOME undefined #76

Closed andredasilvapinto closed 10 years ago

andredasilvapinto commented 10 years ago

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.

eswdd commented 10 years ago

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 25

replacing ${env.JAVA_HOME} with ${java.home} on the referred lines fixed the problem.

— Reply to this email directly or view it on GitHub.

andredasilvapinto commented 10 years ago

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

andredasilvapinto commented 10 years ago

also http://stackoverflow.com/a/3080695/43046

eswdd commented 10 years ago

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.

andredasilvapinto commented 10 years ago

My intention with the stackoverflow post was just to show a typical configuration for the JDK tools dependency using java.home.

eswdd commented 10 years ago

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 https://github.com/betfair/cougar/issues/76#issuecomment-48607244.