GNU bug report logs - #40234
[java-iroha] Gradle fails with "Could not find tools.jar"

Previous Next

Package: guix;

Reported by: Pierre Neidhardt <mail <at> ambrevar.xyz>

Date: Thu, 26 Mar 2020 07:39:02 UTC

Severity: normal

To reply to this bug, email your comments to 40234 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#40234; Package guix. (Thu, 26 Mar 2020 07:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pierre Neidhardt <mail <at> ambrevar.xyz>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 26 Mar 2020 07:39:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: bug-guix <at> gnu.org
Cc: Ricardo Wurmus <rekado <at> elephly.net>, Julien Lepiller <julien <at> lepiller.eu>
Subject: [java-iroha] Gradle fails with "Could not find tools.jar"
Date: Thu, 26 Mar 2020 08:38:23 +0100
[Message part 1 (text/plain, inline)]
Hi!

I'm trying to build https://github.com/hyperledger/iroha-java manually
with Gradle (tried with Guix but I'm stuck), and I get the following
error:

--8<---------------cut here---------------start------------->8---
Execution failed for task ':client:compileJava'.
Could not find tools.jar.
--8<---------------cut here---------------end--------------->8---

Then it suggests that the Java installation might be wrong.
I tried with icedtea 3.7.0, openjdk 9 and openjdk 12, to no avail.

Are our JDK packages wrong missing some jars?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#40234; Package guix. (Thu, 26 Mar 2020 10:23:01 GMT) Full text and rfc822 format available.

Message #8 received at 40234 <at> debbugs.gnu.org (full text, mbox):

From: Roel Janssen <roel <at> gnu.org>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>, 40234 <at> debbugs.gnu.org
Subject: Re: bug#40234: [java-iroha] Gradle fails with "Could not find
 tools.jar"
Date: Thu, 26 Mar 2020 11:22:06 +0100
On Thu, 2020-03-26 at 08:38 +0100, Pierre Neidhardt wrote:
> Hi!
> 
> I'm trying to build https://github.com/hyperledger/iroha-java manually
> with Gradle (tried with Guix but I'm stuck), and I get the following
> error:
> 
> --8<---------------cut here---------------start------------->8---
> Execution failed for task ':client:compileJava'.
> Could not find tools.jar.
> --8<---------------cut here---------------end--------------->8---
> 
> Then it suggests that the Java installation might be wrong.
> I tried with icedtea 3.7.0, openjdk 9 and openjdk 12, to no avail.
> 
> Are our JDK packages wrong missing some jars?
> 

The "tools.jar" is only in de icedtea:jdk output.
You might also need to set environment variable JAVA_HOME to the Guix profile
root that contains icedtea:jdk.

Kind regards,
Roel Janssen







Information forwarded to bug-guix <at> gnu.org:
bug#40234; Package guix. (Thu, 26 Mar 2020 11:42:01 GMT) Full text and rfc822 format available.

Message #11 received at 40234 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Roel Janssen <roel <at> gnu.org>, 40234 <at> debbugs.gnu.org
Subject: Re: bug#40234: [java-iroha] Gradle fails with "Could not find
 tools.jar"
Date: Thu, 26 Mar 2020 12:41:33 +0100
[Message part 1 (text/plain, inline)]
Roel Janssen <roel <at> gnu.org> writes:

> The "tools.jar" is only in de icedtea:jdk output.
> You might also need to set environment variable JAVA_HOME to the Guix profile
> root that contains icedtea:jdk.

Thanks, this is probably related!

However

--8<---------------cut here---------------start------------->8---
env JAVA_HOME=/home/ambrevar/.guix-extra-profiles/dev/dev ./gradlew jar
--8<---------------cut here---------------end--------------->8---

fails with the same error.

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#40234; Package guix. (Thu, 26 Mar 2020 11:43:01 GMT) Full text and rfc822 format available.

Message #14 received at 40234 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Roel Janssen <roel <at> gnu.org>, 40234 <at> debbugs.gnu.org
Subject: Re: bug#40234: [java-iroha] Gradle fails with "Could not find
 tools.jar"
Date: Thu, 26 Mar 2020 12:42:32 +0100
[Message part 1 (text/plain, inline)]
By the way, should JAVA_HOME be a native-search-path set by the JDKs?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#40234; Package guix. (Thu, 26 Mar 2020 11:53:01 GMT) Full text and rfc822 format available.

Message #17 received at 40234 <at> debbugs.gnu.org (full text, mbox):

From: Roel Janssen <roel <at> gnu.org>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>, 40234 <at> debbugs.gnu.org
Subject: Re: bug#40234: [java-iroha] Gradle fails with "Could not find
 tools.jar"
Date: Thu, 26 Mar 2020 12:52:32 +0100
On Thu, 2020-03-26 at 12:41 +0100, Pierre Neidhardt wrote:
> Roel Janssen <roel <at> gnu.org> writes:
> 
> > The "tools.jar" is only in de icedtea:jdk output.
> > You might also need to set environment variable JAVA_HOME to the Guix
> > profile
> > root that contains icedtea:jdk.
> 
> Thanks, this is probably related!
> 
> However
> 
> --8<---------------cut here---------------start------------->8---
> env JAVA_HOME=/home/ambrevar/.guix-extra-profiles/dev/dev ./gradlew jar
> --8<---------------cut here---------------end--------------->8---
> 
> fails with the same error.
> 

Uh, I looked through one of my Java-related packages and found this snippet:

----------
;; Set JAVA_HOME to help maven find the JDK.
(setenv "JAVA_HOME" (string-append (assoc-ref inputs "icedtea")
                                   "/jre"))
----------

So perhaps JAVA_HOME needs to point to <profile-root>/jre.  (Sorry for the
previous suggestion..)

I'm not sure why I added this snippet though, but perhaps it's worth a try.

Kind regards,
Roel Janssen





Information forwarded to bug-guix <at> gnu.org:
bug#40234; Package guix. (Thu, 26 Mar 2020 12:47:02 GMT) Full text and rfc822 format available.

Message #20 received at 40234 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Roel Janssen <roel <at> gnu.org>, 40234 <at> debbugs.gnu.org
Subject: Re: bug#40234: [java-iroha] Gradle fails with "Could not find
 tools.jar"
Date: Thu, 26 Mar 2020 13:46:12 +0100
[Message part 1 (text/plain, inline)]
It worked!  Thanks a lot!

So what do you think of adding

(native-search-paths (list (search-path-specification
                                (variable "JAVA_HOME")
                                (files '("jre")))))

to icedtea-* and openjdk-*?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#40234; Package guix. (Thu, 26 Mar 2020 13:40:02 GMT) Full text and rfc822 format available.

Message #23 received at 40234 <at> debbugs.gnu.org (full text, mbox):

From: Roel Janssen <roel <at> gnu.org>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>, 40234 <at> debbugs.gnu.org
Subject: Re: bug#40234: [java-iroha] Gradle fails with "Could not find
 tools.jar"
Date: Thu, 26 Mar 2020 14:39:48 +0100
On Thu, 2020-03-26 at 13:46 +0100, Pierre Neidhardt wrote:
> It worked!  Thanks a lot!
> 
> So what do you think of adding
> 
> (native-search-paths (list (search-path-specification
>                                 (variable "JAVA_HOME")
>                                 (files '("jre")))))
> 
> to icedtea-* and openjdk-*?
> 

I'm not sure if JAVA_HOME is only needed to build things (so only for the JDK),
or whether it's also useful for JRE.

I agree that it would be good to set when the JDK variant is installed.

Kind regards,
Roel Janssen





Information forwarded to bug-guix <at> gnu.org:
bug#40234; Package guix. (Thu, 02 Apr 2020 07:26:02 GMT) Full text and rfc822 format available.

Message #26 received at 40234 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Roel Janssen <roel <at> gnu.org>, 40234 <at> debbugs.gnu.org
Cc: guix-devel <at> gnu.org
Subject: Re: bug#40234: [java-iroha] Gradle fails with "Could not find
 tools.jar"
Date: Thu, 02 Apr 2020 09:25:17 +0200
[Message part 1 (text/plain, inline)]
Roel Janssen <roel <at> gnu.org> writes:

>> So what do you think of adding
>> 
>> (native-search-paths (list (search-path-specification
>>                                 (variable "JAVA_HOME")
>>                                 (files '("jre")))))
>> 
>> to icedtea-* and openjdk-*?
>> 
>
> I'm not sure if JAVA_HOME is only needed to build things (so only for the JDK),
> or whether it's also useful for JRE.
>
> I agree that it would be good to set when the JDK variant is installed.

Is it possible to set the search-path only for a given output?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 4 years and 23 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.