Last active
August 29, 2015 14:27
-
-
Save ravibhure/00b0729a81b2499dd444 to your computer and use it in GitHub Desktop.
How to retrieve java version
This file contains hidden or 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/sh | |
JAVA_VERSION=`echo "$(java -version 2>&1)" | grep "java version" | awk '{ print substr($3, 2, length($3)-2); }'` | |
echo $JAVA_VERSION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment