This problem persisted after updating and upgrading sdkman, deleting .sdkman and reinstalling it, and uninstalling java packages and reinstalling them.
me@myMachine myProject $ sdk default java 8.0.252.hs-adpt
Default java version set to 8.0.252.hs-adpt
me@myMachine myProject $ sdk default java
Default java version set to 11.0.7.hs-adpt
sdk current java and java -version reflect the change but reverts back to 11.0.7 upon closing and reopening terminal, or opening a different window or app.
I just happen to get that error, on Manjaro ..after an update of the S.O., so the error is the /usr/bin/java now points to the default java installed on the update.
So i just removed all Java versions installed on the updates cause I need only to use the sdkman.
sdk home java 8.0.232.hs-adpt
With this i can see where are the candidates on my case:
/home/xxxx/.sdkman/candidates/java/8.0.232.hs-adpt
So after removed all java: i run java -version i found there is no java anymore.
So i force update sdkman
sdk selfupdate force
Then after install
source "$HOME/.sdkman/bin/sdkman-init.sh"
And to be sure i ran :
ls -al /usr/bin/java
lrwxrwxrwx 1 root root 37 may 16 2020 /usr/bin/java -> /usr/lib/jvm/default-runtime/bin/java
and now it points to where sdkman supposed to:
And thats it now i can change versions again with sdkman.
sdk use java 11.0.5.hs-adpt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With