Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 634046 - After emerging dev-build/bazel-0.5.2 there should be advice to set JAVA_HOME
Summary: After emerging dev-build/bazel-0.5.2 there should be advice to set JAVA_HOME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Jason Zaman
Depends on:
Blocks: 922374
  Show dependency tree
Reported: 2017-10-11 20:30 UTC by Rabbe Fogelholm
Modified: 2024-01-18 12:09 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---

Output of `emerge --info' (e.txt,5.27 KB, text/plain)
2017-10-11 20:32 UTC, Rabbe Fogelholm

Note You need to log in before you can comment on or make changes to this bug.
Description Rabbe Fogelholm 2017-10-11 20:30:32 UTC
Typing `bazel help' produces 

    Couldn't find java at '/usr/libexec/bin/java'.

This can be fixed by setting JAVA_HOME, e.g. like this,

    export JAVA_HOME=`java-config --jdk-home`

I suggest that an "emerge message" is added for this, to make it easier
getting started, especially since there is no manpage and `bazel --help`
does not work either.
Comment 1 Rabbe Fogelholm 2017-10-11 20:32:43 UTC
Created attachment 498402 [details]
Output of `emerge --info'
Comment 2 Zac Medico gentoo-dev 2017-10-30 00:36:07 UTC
Normally JAVA_HOME is set by /etc/profile.d/ which is installed by sys-apps/baselayout-java. Do you have that file?
Comment 3 Zac Medico gentoo-dev 2017-10-30 03:13:30 UTC
Since bazel already has a java-config dependency from the java-pkg-2 eclass it inherits, you probably just need to do this:

  source /etc/profile

I suppose would would suggest to do that with an elog message on the first install, possibly using the readme.gentoo-r1 eclass.
Comment 4 Alessandro Barbieri 2021-10-25 07:10:28 UTC
I can run bazel as an user but not inside ebuilds
echo $JAVA_HOME inside an ebuild return nothing
You say that the bazel eclass is inheriting java-pkg-2 but that isn't true