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 java 8 version check #260

Merged
merged 1 commit into from
Jun 21, 2014
Merged

Fix java 8 version check #260

merged 1 commit into from
Jun 21, 2014

Conversation

mpilquist
Copy link
Contributor

The Java 8 version check in the bash-template does not currently work. There are two issues:

  • Typo in the guard name: no_java_version_check instead of no_version_check
  • Assumes $java_version is a global variable but that is not currently exported by java_version_check, at least when running under bash 3.2.51(1)-release on OS X Mavericks

@@ -284,7 +284,7 @@ loadConfigFile() {
# Now check to see if it's a good enough version
# TODO - Check to see if we have a configured default java version, otherwise use 1.6
java_version_check() {
declare -r java_version=$("$java_cmd" -version 2>&1 | awk -F '"' '/version/ {print $2}')
readonly java_version=$("$java_cmd" -version 2>&1 | awk -F '"' '/version/ {print $2}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readonly declares java_version globally and declare -r doesn't?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I found while testing with the mentioned bash version. I'm by no means a bash expert though so maybe there's a better way to do this? I stumbled upon the readonly trick here: http://stackoverflow.com/a/12158728/547212

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very interesting as this seems to depend on the bash version. I'll need to take a closer look at this.
Thanks for the research!

@muuki88
Copy link
Contributor

muuki88 commented Jun 6, 2014

this pr is not lost! I hope to get to it as soon as possible.

@jsuereth
Copy link
Member

LGTM

jsuereth added a commit that referenced this pull request Jun 21, 2014
@jsuereth jsuereth merged commit 755102d into sbt:master Jun 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants