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

JAVA_HOME ignored if "which java" returns nonzero #258

Closed
tfmorris opened this issue Oct 15, 2012 · 4 comments
Closed

JAVA_HOME ignored if "which java" returns nonzero #258

tfmorris opened this issue Oct 15, 2012 · 4 comments
Labels
imported from old code repo Issue imported from Google Code in 2010 Priority: Medium Represents important issues that need to be addressed but are not urgent Type: Bug Issues related to software defects or unexpected behavior, which require resolution.
Milestone

Comments

@tfmorris
Copy link
Member

Original author: fgr...@gmail.com (November 27, 2010 16:52:51)

What steps will reproduce the problem?

  1. Have default java version be less than 1.6
  2. Have 1.6 version of java installed in an alternate location
  3. Set $JAVA_HOME to alternate 1.6 java directory

What is the expected output? What do you see instead?

  1. ./refine should restart
  1. An error message saying that google-refine requires java 1.6 or higher

What version of the product are you using? On what operating system?
2.0-r1836, linux

Please provide any additional information below.
Problem fixed by adding changing java version code to following:

if [ "$JAVA_HOME" ] ; then
JAVA="$JAVA_HOME/bin/java"
else
JAVA="which java 2> /dev/null"
fi

JAVA_VERSION=$JAVA -version 2>&1 | grep version | cut -d ' ' -f 3 | egrep ^\"1\.6
if [ -z "$JAVA_VERSION" ] ; then
error "Google Refine requires Java version 6 or later. If you have multiple versions of Java installed, please set JAVA_HOME to the correct version."
fi

Original issue: http://code.google.com/p/google-refine/issues/detail?id=258

@tfmorris
Copy link
Member Author

From tfmorris on December 05, 2010 17:53:08:
An approach which doesn't require code changes (and also makes your environment less confusing since everything will match) is to add $JAVA_HOME/bin to the appropriate place in your shell's path.

@tfmorris
Copy link
Member Author

From fgr...@gmail.com on December 05, 2010 18:57:16:
I'm sorry for a confusing bug report. The real problem is that the present script ignores JAVA_HOME if "which java" returns non-zero.

@tfmorris
Copy link
Member Author

From fgr...@gmail.com on December 05, 2010 19:01:17:
But, if you don't want to change the logic flow, the error message should be changed, to tell the user to add java 1.6+ to their path instead of telling them to change $JAVA_HOME

@tfmorris
Copy link
Member Author

From stefa...@google.com on December 24, 2010 21:17:44:
fixed in trunk at r1957.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imported from old code repo Issue imported from Google Code in 2010 Priority: Medium Represents important issues that need to be addressed but are not urgent Type: Bug Issues related to software defects or unexpected behavior, which require resolution.
Projects
None yet
Development

No branches or pull requests

1 participant