[ https://issues.apache.org/jira/browse/SOLR-7460?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jan Høydahl closed SOLR-7460. ----------------------------- Resolution: Won't Fix The script has been rewritten and now Java8 is a requirement for both master and 6.x, so the minor version tests are gone. We won't fix this for the end-of-life 5.x series. Closing. > bin/solr start command shows an error when used with Java 1.7.0 - bin/solr: > line 1290: [[: .0: syntax error: operand expected (error token is ".0") > --------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: SOLR-7460 > URL: https://issues.apache.org/jira/browse/SOLR-7460 > Project: Solr > Issue Type: Bug > Components: scripts and tools > Affects Versions: 5.1 > Reporter: Prasanta Behera > Priority: Trivial > Labels: easyfix, easytest > Attachments: screenshot-1.png, screenshot.png > > > I am trying to start Solr 5.1.0 using Java 1.7.0, Solr does start but I see > this error: > $ bin/solr start > bin/solr: line 1290: [[: .0: syntax error: operand expected (error token is > ".0") > Waiting to see Solr listening on port 8983 [/] > Started Solr server on port 8983 (pid=13627). Happy searching! > Digging further, I saw in solr script: > 1285 JAVA_VERSION=`echo "$("$JAVA" -version 2>&1)" | grep "java version" | > awk '{ print substr($3, 2, length($3)-2); }'` > 1286 if [ "${JAVA_VERSION:0:3}" == "1.7" ]; then > 1287 # Specific Java version hacking > 1288 #GC_TUNE+=('-XX:CMSFullGCsBeforeCompaction=1' > '-XX:CMSTriggerPermRatio=80') > 1289 JAVA_MINOR_VERSION=${JAVA_VERSION:(-2)} > 1290 if [[ $JAVA_MINOR_VERSION -ge 40 && $JAVA_MINOR_VERSION -le 51 ]]; > then > 1291 GC_TUNE+=('-XX:-UseSuperWord') > 1292 echo -e "\nWARNING: Java version $JAVA_VERSION has known bugs with > Lucene and requires the -XX:-UseSuperWord flag. Please consider upgrading > your JVM.\n" > When JAVA_VERSION is 1.7.0 to 1.7.9 the line (#1289): > JAVA_MINOR_VERSION=${JAVA_VERSION:(-2)} > will evaluate JAVA_MINOR_VERSION as .0 hence the if check that follows fails. > The above code would work fine for Java versions 1.7.10 and above > This line should be changed to (chop the string 4 positions from start to get > the minor version, instead of chopping 2 positions from the end) > JAVA_MINOR_VERSION=${JAVA_VERSION:(4)} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org