[
https://issues.apache.org/jira/browse/SOLR-7460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14511055#comment-14511055
]
Shawn Heisey commented on SOLR-7460:
------------------------------------
*All* Java 7 versions are 1.7.0. The information after the 1.7.0 version is
what is different, at least for implementations other than the one from IBM.
It appears that IBM does not follow the typical version string semantics that
the other implementations do. Here are a couple of other version outputs:
[root@idxa1 ~]# java -version
java version "1.7.0_72"
Java(TM) SE Runtime Environment (build 1.7.0_72-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.72-b04, mixed mode)
java[root@bigindy5 ~]# java -version
java version "1.7.0_71"
OpenJDK Runtime Environment (rhel-2.5.3.1.el7_0-x86_64 u71-b14)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
IBM's Java has a history of bugs resulting from extreme optimizations in their
virtual machine, bugs which are tripped by the Lucene code that Solr relies on.
You should not be using IBM's Java with Solr. Use the latest version of
Oracle Java or OpenJDK that you can get.
I do not think we will be fixing this particular problem, because IBM does not
follow the version convention established by Oracle, and IBM's Java is known to
cause severe problems with Lucene programs.
> 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: [email protected]
For additional commands, e-mail: [email protected]