halcyon / asdf-java

A Java plugin for asdf-vm.
MIT License
440 stars 84 forks source link

Unable to clear JAVA_HOME #178

Open nirvdrum opened 2 years ago

nirvdrum commented 2 years ago

I work on a project where it's necessary to clear the JAVA_HOME environment variable in order to get the build script to use its own bundled JVM. I'm finding that asdf-java always resets JAVA_HOME right after I clear it. I'm using the fish shell, for what it's worth, following the steps in the docs for loading the plugin. I think the solution might be to just set JAVA_HOME at shell startup. Currently, a somewhat costly process is initiated whenever I read an env var as asdf-java detects the active JDK and sets JAVA_HOME to point at it.

mills-nick commented 1 year ago

are you using asdf_update_java_home? This was always setting my JAVA_HOME to /usr