Closed algomaster99 closed 4 months ago
I don't want to source my sdkman-init.sh before the test.
you should just pass PATH to your subprocess. in your main process, it found the right java in the PATH, right? so let is use the same PATH value in your subprocess.
Thanks, this helped!
it found the right java in the PATH, right?
I had to set the PATH
manually in IntelliJ runner configuration and then it worked.
Question
I am running a
java
subprocess in my test suite, but the test fails with error that it could not findjava
becausesdkman
initializes in~/.zshrc
and the path is also updated then.However, if we symplink
~/.sdkman/candidates/java/current/bin/java
to/usr/bin/java
, it should also be detected in a subprocess. Is there a better solution than this? I don't want to source mysdkman-init.sh
before the test.System info
bash --version
/zsh --version
)sdk version