Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed bash wrapper error with Java version (as in MIXCR & mitools) #131

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions vdjtools
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,24 @@

java="java"

sedString="s/.*1\.\(.*\)\..*/\1/"
jVersion=$($java -version 2>&1 | grep version | awk '{ print $3 }' | sed $sedString)
if [[ $jVersion -lt 7 ]];
then
echo "Wrong java version. Please use Java 7 or higher."
sedString1="s/\s*\([^.]*\)\..*/\1/"
sedString2="s/.*1\.\(.*\)\..*/\1/"
jVersion=$($java -version 2>&1 | grep version | awk '{ print $3 }' | sed 's:"::g')
jVersion1=$(echo "$jVersion" | sed $sedString1)
if [[ jVersion1 -eq 1 ]]; then
jVersion2=$(echo "$jVersion" | sed $sedString2)
if [[ $jVersion2 -lt 7 ]];
then
echo "Wrong version of java. Please use Java 7 or higher."
exit 1
fi

if [[ $jVersion2 -lt 8 ]];
then
echo "WARNING: Several issues have been detected while using Java 7. Please consider updateing to Java 8 or higher."
fi
elif [[ jVersion1 -lt 9 ]]; then
echo "Wrong version of java. Please use Java 7 or higher."
exit 1
fi

Expand Down