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

FIX #203 Adding check for java 8 #204

Merged
merged 1 commit into from
Mar 30, 2014
Merged

Conversation

muuki88
Copy link
Contributor

@muuki88 muuki88 commented Mar 28, 2014

Tested on Ubuntu 13.04

@kardapoltsev
Copy link
Member

&& [[ java_version > "1.8" ]]

This is false for Java_version = 1.8. May be you mean java_version > "1.7"?

@muuki88
Copy link
Contributor Author

muuki88 commented Mar 28, 2014

I thought so, too. However the java -version returns 1.8.0 which is actually > than 1.8. Which also means that 1.7 is also > than 1.7.1.

@kardapoltsev
Copy link
Member

[ "1.7.1" > "1.8" ]

is also true, but we wanna add -XX:MaxPermSize on java 1.7. May be we could try this:

[ ${java_version:0:3} < "1.8" ]

@muuki88
Copy link
Contributor Author

muuki88 commented Mar 29, 2014

Hm, I checked again with following results

v1="1.7"
v2="1.7.1"
v3="1.8"
v4="1.8.1"

# formula 1
if [[ ${v4:0:3} < "1.8" ]]; then
    echo "v:0:3 < 1.8"
fi

# formula 2
if [[ "$v4" > "1.8" ]]; then
    echo "version > 1.8"
fi
input formula 1 formula 2
"1.7" true false
"1.7.1" true false
"1.8" false false
"1.8.1" false true

Formula 2 is the one in the pull request and with this result it works as expected (as there should be no version with just x.y). Can you verify this? On which system did you test?

@kardapoltsev
Copy link
Member

My test results (more info about bash and system http://pastebin.com/qdCxv9u5).

I have different results only for version 1.8 -- in this case formula 2 doing wrong and add MaxPermSize param, but since we don't have such output from java -version, we could omit this case IMHO.

And excuse me, I forgot one little note

the ">" needs to be escaped within a [ ] construct.
and that's why I got wrong results.

muuki88 added a commit that referenced this pull request Mar 30, 2014
@muuki88 muuki88 merged commit 8b7882e into master Mar 30, 2014
@muuki88 muuki88 deleted the wip/java8-script-warnings branch March 30, 2014 10:25
@muuki88
Copy link
Contributor Author

muuki88 commented Mar 30, 2014

Thanks for your investigations :) Always fun to with you to test the edges ;)

You are right, we can omit the case with just major.minor version as this will not be the case. I really like the testing with pastebin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants