Skip to content

Commit

Permalink
Use JAVA_HOME to find the current version
Browse files Browse the repository at this point in the history
  • Loading branch information
ldziedziul committed Sep 3, 2020
1 parent f289a04 commit 48d0ad5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion j.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

function print_usage() {
VERSIONS=$(ls $SDKMAN_DIR/candidates/java | grep -v current | awk -F'.' '{print $1}' | sort -nr | uniq)
CURRENT=$(basename $(readlink $SDKMAN_DIR/candidates/java/current) | awk -F'.' '{print $1}')
CURRENT=$(basename $(readlink $JAVA_HOME || echo $JAVA_HOME) | awk -F'.' '{print $1}')
echo "Available versions: "
echo "$VERSIONS"
echo "Current: $CURRENT"
Expand Down

0 comments on commit 48d0ad5

Please sign in to comment.