Created
May 1, 2019 15:38
-
-
Save EugenMayer/10b79dccf2a48c01c7b0e6cd11e0ce2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "removing current jenv java's to readd them freshly" | |
jenv versions --bare | xargs -n1 jenv remove | |
echo "adding all sdkmans java versions to jenv" | |
find $HOME/.sdkman/candidates/java -type d -maxdepth 1 -mindepth 1 -exec jenv add '{}' \; |
You may want to add in a line to ensure that the jenv config folders exist too:
mkdir -p $HOME/.jenv/versions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
find: warning: you have specified the global option -maxdepth after the argument -type, but global options are not positional, i.e., -maxdepth affects tests specified before it as well as those specified after it. Please specify global options before other arguments.
find: warning: you have specified the global option -mindepth after the argument -type, but global options are not positional, i.e., -mindepth affects tests specified before it as well as those specified after it. Please specify global options before other arguments.
move -type d after -mindepth 1
find $HOME/.sdkman/candidates/java -maxdepth 1 -mindepth 1 -type d -exec jenv add '{}' ;