You are not logged in.
When I start groovy, it fails after:
which: no javac in (/home/diederick/.gem/ruby/3.0.0/bin:/home/diederick/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/home/diederick/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
groovy: JAVA_HOME not set and cannot find javac to deduce location, please set JAVA_HOME.Indeed,
$ env | grep JAVA_HOMEcomes up empty.
However:
$ pacman -Qo javac
/usr/bin/javac is eigendom van java-environment-common 3-5I installed java using archlinux-java.
$ archlinux-java status
Available Java environments:
java-11-openjdk
java-17-openjdk (default)
java-21-openjdk
java-7-openjdk/jre
java-8-openjdk/jreI could I set JAVA_HOME to whatever is the current environment, but then it wouldn't change when setting another. So, how do I correctly tell groovy where it will find the java compiler?
Last edited by diederick76 (2023-12-23 07:15:01)
Offline
archlinux-java always points to /usr/lib/jvm/default/bin. Apparently groovy doesn't know about this, and has no way of checking (multiplatform). Therefore DO set $JAVA_HOME to the aforementioned path and you can continue to use archlinux-java as intended
Offline
Thanks. There was something odd with java 17. Its bin directory did not contain javac, which was why groovy couldn't find it. Reinstalling jdk17-openjdk fixed this.
Offline