Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • Adding the first export statement to my .bashrc did the job like a charm. I didnt go for rest since my PATH is auto adjusted by alternatives. It works when my jdk selected is 17 but i dont see any reason why it shouldn't work with other jdk versions. Commented May 6, 2023 at 5:46
  • Still not clear - Why we need dirname twice ? export JAVA_HOME=$(dirname readlink -f /etc/alternatives/java) this should work or ? Commented May 6, 2023 at 6:46