Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions changelog/unreleased/PR#4765-improve-java-version-parsing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc
title: Tolerate JVM warning lines when detecting Java version
type: fixed # added, changed, fixed, deprecated, removed, dependency_update, security, other
authors:
- name: Matthias Pigulla
nick: mpdude
links:
- name: PR#4765
url: https://github.com/apache/solr/pull/4765
2 changes: 1 addition & 1 deletion solr/bin/solr
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ if [[ $? -ne 0 ]] ; then
echo >&2 "${PATH}"
exit 1
else
JAVA_VER_NUM=$(echo "$JAVA_VER" | grep -v '_OPTIONS' | head -1 | awk -F '"' '/version/ {print $2}' | sed -e's/^1\.//' | sed -e's/[._-].*$//')
JAVA_VER_NUM=$(echo "$JAVA_VER" | grep -v '_OPTIONS' | awk -F '"' '/ version "/ {print $2; exit}' | sed -e's/^1\.//' | sed -e's/[._-].*$//')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

have these been run against a bunch of different jdk versions to see if this works?

if (( JAVA_VER_NUM < JAVA_VER_REQ )) ; then
echo >&2 "Your current version of Java is too old to run this version of Solr."
echo >&2 "We found major version $JAVA_VER_NUM, using command '${JAVA} -version', with response:"
Expand Down
Loading