[java-iroha] Gradle fails with "Could not find tools.jar"

  • Open
  • quality assurance status badge
Details
2 participants
  • Pierre Neidhardt
  • Roel Janssen
Owner
unassigned
Submitted by
Pierre Neidhardt
Severity
normal
P
P
Pierre Neidhardt wrote on 26 Mar 2020 08:38
(address . bug-guix@gnu.org)
878sjny39s.fsf@ambrevar.xyz
Hi!

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

Toggle snippet (4 lines)
Execution failed for task ':client:compileJava'.
Could not find tools.jar.

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
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl58W+8ACgkQm9z0l6S7
zH+fUwf6AzBNetLkT+0r3+XN7hWE6kMgMlPragjjI+ZlrYV1J4Oj3oufsaeuA6rZ
ujsLOr6fPLL+686bCY6eYq9EfGURbbxkU60NROyJ8qFHsgyAw3Jocc+2L8g+tNqS
X9bxrai1yBabsJgxnUfOzcBzVL8Si6uPGdfyVWrS/fgJU3WF5kqOrJ2ZIjfSIy2C
PQw6zGpLBjbLLbe6jA86o2zWKTpA/deQyKmA+UWJuxoA83QB0/QyVA6c74a8+aKi
q4v2mIB3Cu59apCjhqexCqPl0JigB11YJLJrhQyAzP6hxVQ+9PFx4ccuVDl8PPWg
F17WChxpIgaH9hjKwBhsqelNGaJIdw==
=OUfn
-----END PGP SIGNATURE-----

R
R
Roel Janssen wrote on 26 Mar 2020 11:22
e5c4b8a0e8a4af12e62731b1f8d20575a3dce593.camel@gnu.org
On Thu, 2020-03-26 at 08:38 +0100, Pierre Neidhardt wrote:
Toggle quote (17 lines)
> 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
P
P
Pierre Neidhardt wrote on 26 Mar 2020 12:41
87wo77z6ky.fsf@ambrevar.xyz
Roel Janssen <roel@gnu.org> writes:

Toggle quote (4 lines)
> 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

Toggle snippet (3 lines)
env JAVA_HOME=/home/ambrevar/.guix-extra-profiles/dev/dev ./gradlew jar

fails with the same error.

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl58lO0ACgkQm9z0l6S7
zH8l4wf+ICUTDde8uhWqoCTXrxbnHyqNf0vEBcf4u7DQTR6SXgKhkFGDiWntTiNS
P4ovm4TPd3lAJGEgfnW9mzphUlWSfipKbfAkFpUfXXLcptIg5UunlnzK8NVWj8Nx
wRoFl07DP22y4oR4xd5hOX7DLcbU9Wdyw5gGvqChMtzoa/5wH4X0yqtUgeS3gHXd
4Q0m6stLRsIa1qptkDVeJirUVDLWV6BUyM+o5D/wnN4W6bMQZxI1yy4E75i/z+/d
I7CNIzG2MJwMTtyOmMrNwsxYCeyuUdQwoJZV1ws0bLMmFgCbK453hbO+9ZzzZuXO
N3V0HecvqB3G3hei493YpzjO9Ox7hA==
=MnbP
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 26 Mar 2020 12:42
87tv2bz6jb.fsf@ambrevar.xyz
By the way, should JAVA_HOME be a native-search-path set by the JDKs?

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl58lSgACgkQm9z0l6S7
zH9h6QgAgDomSGOZ8mDwfHJe4yrcmNUNUCtqQvLqzLiB34xai1UGGkenATHi8mkn
0z/RNG3h95WrlAlXmp08oodv0cd9DMbP+OKOPw7mOnlismDUvdcdUptS/Q6boUEV
wTNOM/JvZhcqaPZ8GVk1O9eV5JTr/U+j2CV0bYsJaDj6MMBwG/1e2vPBIKp7vXbu
zW9m3EtFWvzJbmtaPYHy5JoA0BVKlXZpl5Peed/V8mb5zHwZXsTYhvg1D2LgoA6Z
BMUKOL50mvzZQqhbOSnZQFPXvkB5l3YX4q2y6Yu9sZP5V3xu3DIW5M950WSC1wv6
VVIdhKr9j3zfgDdvTZ1DWwp+RvJJ6Q==
=Iv/U
-----END PGP SIGNATURE-----

R
R
Roel Janssen wrote on 26 Mar 2020 12:52
c1297d4b39eb83c06c3dbf10bef60c93d881f4e8.camel@gnu.org
On Thu, 2020-03-26 at 12:41 +0100, Pierre Neidhardt wrote:
Toggle quote (18 lines)
> Roel Janssen <roel@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
P
P
Pierre Neidhardt wrote on 26 Mar 2020 13:46
87o8sjz3l7.fsf@ambrevar.xyz
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
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl58pBQACgkQm9z0l6S7
zH8ZQwf6A2HGtKTcroEi8rfchI8WiTA3r+aEEcQh5YSxLxUUdhrkzN5jZepuoehp
jFNsIf05KKno99LBK/ObLrqkh3ZXt4Jx9HIPVzt8WD5Vj4TGZYgB+Y6cNlvD5pC2
KmrP/I/GnBuEMyIS7PXNi3x/zjwkRwj0+PVnsuMHsWSv89N3jYvM0yHOYnnyejDT
chPhbSb+w5SIacQ4DCMKr1gcIlJAcQymj9AwZjZ/bza7gJauVqgFzw9mJBD89lsV
1ItFqQ+oPS8omhC+JoQXgj/vgFRbwiI4HdLf4LzVJ8IIqJezEGkjxYaw0aGd98Vv
RUaktflIKRCFbXpiQKTtfNO/SDnstA==
=Vgk6
-----END PGP SIGNATURE-----

R
R
Roel Janssen wrote on 26 Mar 2020 14:39
9bf49c49ba6cb5627985c12e0867ae5565b5bb98.camel@gnu.org
On Thu, 2020-03-26 at 13:46 +0100, Pierre Neidhardt wrote:
Toggle quote (11 lines)
> 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
P
P
Pierre Neidhardt wrote on 2 Apr 2020 09:25
(address . guix-devel@gnu.org)
87mu7ubb8i.fsf@ambrevar.xyz
Roel Janssen <roel@gnu.org> writes:

Toggle quote (14 lines)
>> 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
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl6Fk10ACgkQm9z0l6S7
zH8jUAf/ZyYmoh4VAOwK3s+sfJLL0Yrl2SDsogqsyQKDRgLsbrNrKdeBtlYC64gt
4QBioP0x0Ocx0VwhKFi5CuK4C+x6j6abmwndHPWcPCn23Epj5B0I1JbAGs5NJQCV
4J1ySDt8Ix99lAkghsNzO8LDrVYw60HMXajkbPIvnYYNmdqF6VW0iGCIKFZEUwtg
CkeyNwqWT1+HA6OVupQzJXqK1gTLViIf7MVzygbV6hCSX3xMhCmDuVPjuxJwWR1B
JXt3OKIZjTfCLOT5OkWWXfT5i+GX78BqbkxvaRCDpzr0ZcSBlEeS1+P22EYBJ7oh
4iDRqWn3UE6kf6uwehYVM7fTgXkArg==
=NV8D
-----END PGP SIGNATURE-----

?