Darklight11 / google-refine

Automatically exported from code.google.com/p/google-refine
0 stars 0 forks source link

JAVA_HOME ignored if "which java" returns nonzero #258

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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
2. 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 reported on code.google.com by fgr...@gmail.com on 27 Nov 2010 at 4:52

GoogleCodeExporter commented 9 years ago
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.

Original comment by tfmorris on 5 Dec 2010 at 5:53

GoogleCodeExporter commented 9 years ago
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. 

Original comment by fgr...@gmail.com on 5 Dec 2010 at 6:57

GoogleCodeExporter commented 9 years ago
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

Original comment by fgr...@gmail.com on 5 Dec 2010 at 7:01

GoogleCodeExporter commented 9 years ago
fixed in trunk at r1957.

Original comment by stefa...@google.com on 24 Dec 2010 at 9:17

GoogleCodeExporter commented 9 years ago

Original comment by stefa...@google.com on 24 Dec 2010 at 9:18

GoogleCodeExporter commented 9 years ago

Original comment by tfmorris on 9 Jun 2011 at 7:58