icedtea: JAVA_HOME

  • Open
  • quality assurance status badge
Details
4 participants
  • Christopher Howard
  • Julien Lepiller
  • Michael Rohleder
  • Ricardo Wurmus
Owner
unassigned
Submitted by
Christopher Howard
Severity
normal
C
C
Christopher Howard wrote on 19 Jul 2020 07:09
(address . bug-guix@gnu.org)
f89d538f045bc4ad46d441a47b0d2636534edd75.camel@qlfiles.net
Hi, I'm not going to pretend to be a Java expert, but I was trying to
build and run a Java application, and had to set JAVA_HOME manually. It
is my understanding from my research[1] that applications often will
want JAVA_HOME set to the path to the java install directory. It would
seem like it would be useful if Guix set that as well for the icedtea
and icedtea:jdk package.

If there are good reasons for that not to be, perhaps more
knowledgeable individuals will explain it.

One part I'm not quite sure about is what JAVA_HOME would be set to if
both icedtea and icedtea:jdk were installed.

[1] Many JAVA_HOME results in a Startpage.com search

--
Christopher Howard
p: +1 (907) 374-0257
gpg: ADDEAADE5D607C8D (keys.gnupg.net)
J
J
Julien Lepiller wrote on 19 Jul 2020 12:29
74E0B4E8-9091-4C4C-A429-9B480446C956@lepiller.eu
Le 19 juillet 2020 01:09:52 GMT-04:00, Christopher Howard <christopher.howard@qlfiles.net> a écrit :
Toggle quote (15 lines)
>Hi, I'm not going to pretend to be a Java expert, but I was trying to
>build and run a Java application, and had to set JAVA_HOME manually. It
>is my understanding from my research[1] that applications often will
>want JAVA_HOME set to the path to the java install directory. It would
>seem like it would be useful if Guix set that as well for the icedtea
>and icedtea:jdk package.
>
>If there are good reasons for that not to be, perhaps more
>knowledgeable individuals will explain it.
>
>One part I'm not quite sure about is what JAVA_HOME would be set to if
>both icedtea and icedtea:jdk were installed.
>
>[1] Many JAVA_HOME results in a Startpage.com search

icedtea being a subset of icedtea:jdk, you can't install both in the same profile anyway.
M
M
Michael Rohleder wrote on 31 Jul 2020 13:49
(name . Christopher Howard)(address . christopher.howard@qlfiles.net)
873657ewfb.fsf@rohleder.de
Hi Christopher,

Christopher Howard <christopher.howard@qlfiles.net> writes:
Toggle quote (13 lines)
> Hi, I'm not going to pretend to be a Java expert, but I was trying to
> build and run a Java application, and had to set JAVA_HOME manually. It
> is my understanding from my research[1] that applications often will
> want JAVA_HOME set to the path to the java install directory. It would
> seem like it would be useful if Guix set that as well for the icedtea
> and icedtea:jdk package.
>
> If there are good reasons for that not to be, perhaps more
> knowledgeable individuals will explain it.
>
> One part I'm not quite sure about is what JAVA_HOME would be set to if
> both icedtea and icedtea:jdk were installed.

I dont think this is a good idea (or even possible?):

From a Developer POV I think its pretty common to have many jdk's installed
(8,11,14 sometimes even 7). To what should JAVA_HOME be set/defaults in this
case?

I dont know a distribution which sets JAVA_HOME (per default) and I
think its much better to let the user or sysadmin decide which one is
best...
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEdV4t5dDVhcUueCgwfHr/vv7yyyUFAl8kBVgACgkQfHr/vv7y
yyXMFwgAuQk5XitWaIsEba9Hg41WQBBGB5SipkUyxC+oy2CkVCzREYb/ZoWDc1gV
v0p+SRBc11suVaTsD96PdVtHuvx7xJ6u/Cb0eNdBI/L0DKFC/Og1zCAujYfeG5I9
ClI3Mgj07y7H6QnxLV0vyDyz5hF3QPtzUdKY1KAT+u8XGhOMWuRaGJf9fRV+GWHq
sElnUVV5tE2g0DgEGoyWWOaQyvt2J63fzHd9Ql8NlUq4Zn0Dp27nPCQWiiF6HF4H
aOh3QUY5b/NW7bTDfg6IYv4Pcw26I0beIesk8wimuNbHBYDxYVmhnmMddRfBvWhx
WT/l8KyRckcMmXDYroNgfwYj9ImiDQ==
=tlJm
-----END PGP SIGNATURE-----

C
C
Christopher Howard wrote on 31 Jul 2020 16:14
(name . Michael Rohleder)(address . mike@rohleder.de)(address . 42423@debbugs.gnu.org)
939e8f05889aebe8be0aa2dd51f356a260d7ecc3.camel@qlfiles.net
Hi, I am open to learning more and to guix developer wisdom. I don't
quite understand your argument, though — I wouldn't think this would be
any more difficult a question than deciding what version of the java
binary would show up in your profile: you would only select one version
in a profile. If you need to work with multiple versions (not talking
about dependencies) you would create multiple profiles, or multiple
manifest files to use with guix environment.

I would assume if we are talking about guix package dependencies, you
are relying on the direct paths. But practical case here is if you just
download some Java code and run "ant build" or "ant run": that won't
work unless "JAVA_HOME" is defined, which is a bother to figure out
yourself every time you want to update your profile. This is what I
have to do to get arduino-ide running (as well as running patchelf on
the generated binaries, but that is another story...)

--
Christopher Howard
p: +1 (907) 374-0257
gpg: ADDEAADE5D607C8D (keys.gnupg.net)

On Fri, 2020-07-31 at 13:49 +0200, Michael Rohleder wrote:
Toggle quote (33 lines)
> Hi Christopher,
>
> Christopher Howard <christopher.howard@qlfiles.net> writes:
> > Hi, I'm not going to pretend to be a Java expert, but I was trying
> > to
> > build and run a Java application, and had to set JAVA_HOME
> > manually. It
> > is my understanding from my research[1] that applications often
> > will
> > want JAVA_HOME set to the path to the java install directory. It
> > would
> > seem like it would be useful if Guix set that as well for the
> > icedtea
> > and icedtea:jdk package.
> >
> > If there are good reasons for that not to be, perhaps more
> > knowledgeable individuals will explain it.
> >
> > One part I'm not quite sure about is what JAVA_HOME would be set to
> > if
> > both icedtea and icedtea:jdk were installed.
>
> I dont think this is a good idea (or even possible?):
>
> From a Developer POV I think its pretty common to have many jdk's
> installed
> (8,11,14 sometimes even 7). To what should JAVA_HOME be set/defaults
> in this
> case?
>
> I dont know a distribution which sets JAVA_HOME (per default) and I
> think its much better to let the user or sysadmin decide which one is
> best...
R
R
Ricardo Wurmus wrote on 31 Jul 2020 17:10
(address . christopher@librehacker.com)
87h7tnhg9j.fsf@elephly.net
Christopher Howard <christopher.howard@qlfiles.net> writes:

Toggle quote (4 lines)
> […] This is what I
> have to do to get arduino-ide running (as well as running patchelf on
> the generated binaries, but that is another story...)

Recently, I also built the Arduino IDE to upload the software onto my
Open Theremin. Instead of using patchelf I opted to make the loader
available globally:

ln -s $(guix build glibc)/lib/ld-linux-x86-64.so.2 /lib64/

On Guix System we can also use “extra-special-file”:

(extra-special-file "/lib64/ld-linux-x86-64.so.2"
(file-append glibc "/lib/ld-linux-x86-64.so.2"))

--
Ricardo
?