You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "mpdude (via GitHub)" <gi...@apache.org> on 2026/08/19 17:11:58 UTC
[PR] Disable SVE when detecting Java version [solr]
mpdude opened a new pull request, #4765:
URL: https://github.com/apache/solr/pull/4765
I am trying to start Solr in a virtual `arm64` Linux machine on Apple Silicon hardware. To my knowledge, this configuration does (currently?) not support SVE vector length detection.
When `bin/solr` runs `java -version`, this makes the JVM emit a notice:
```
Starting Solr
Your current version of Java is too old to run this version of Solr.
We found major version , using command '/opt/java/openjdk/bin/java -version', with response:
OpenJDK 64-Bit Server VM warning: Unable to get SVE vector length on this system. Disabling SVE. Specify -XX:UseSVE=0 to shun this warning.
openjdk version "25.0.3" 2026-04-21 LTS
OpenJDK Runtime Environment Temurin-25.0.3+9 (build 25.0.3+9-LTS)
OpenJDK 64-Bit Server VM Temurin-25.0.3+9 (build 25.0.3+9-LTS, mixed mode, sharing)
Please install latest version of Java 21 or set JAVA_HOME properly.
```
Version detection trips over this extra warning line, so my suggestion is to disable SVE for the version check. Any performance impact it might have is probably neglectable for this case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] Disable SVE when detecting Java version [solr]
Posted by "mpdude (via GitHub)" <gi...@apache.org>.
mpdude commented on PR #4765:
URL: https://github.com/apache/solr/pull/4765#issuecomment-5625842286
Is that good enough?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] Disable SVE when detecting Java version [solr]
Posted by "risdenk (via GitHub)" <gi...@apache.org>.
risdenk commented on code in PR #4765:
URL: https://github.com/apache/solr/pull/4765#discussion_r3837405363
##########
solr/bin/solr:
##########
@@ -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/[._-].*$//')
Review Comment:
have these been run against a bunch of different jdk versions to see if this works?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] Tolerate JVM warning lines when detecting Java version [solr]
Posted by "mpdude (via GitHub)" <gi...@apache.org>.
mpdude commented on PR #4765:
URL: https://github.com/apache/solr/pull/4765#issuecomment-5741053481
Changelog entry added, rebased & squashed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] Disable SVE when detecting Java version [solr]
Posted by "HoustonPutman (via GitHub)" <gi...@apache.org>.
HoustonPutman commented on PR #4765:
URL: https://github.com/apache/solr/pull/4765#issuecomment-5346135845
That's weird. When I run the `solr:10` image via Docker Desktop on Apple Silicon (which will make a linux vm), I see no issue.
```
$ java -version
openjdk version "25.0.3" 2026-04-21 LTS
OpenJDK Runtime Environment Temurin-25.0.3+9 (build 25.0.3+9-LTS)
OpenJDK 64-Bit Server VM Temurin-25.0.3+9 (build 25.0.3+9-LTS, mixed mode, sharing)
```
```
Starting Solr
[0.001s][warning][pagesize] UseLargePages disabled, no large pages configured and available on the system.
WARNING: Using incubator modules: jdk.incubator.vector
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::arrayBaseOffset has been called by com.lmax.disruptor.RingBufferFields (file:/opt/solr-10.0.0/server/lib/ext/disruptor-3.4.4.jar)
WARNING: Please consider reporting this to the maintainers of class com.lmax.disruptor.RingBufferFields
WARNING: sun.misc.Unsafe::arrayBaseOffset will be removed in a future release
2026-08-19 18:02:56.622 INFO (main) [] o.e.j.s.Server jetty-12.0.27; built: 2025-09-10T23:47:49.595Z; git: 3569a3e83ad136ee44e26b370b74c1c5e9f33e61; jvm 25.0.3+9-LTS
2026-08-19 18:02:56.740 INFO (main) [] o.e.j.e.w.StandardDescriptorProcessor NO JSP Support for /solr, did not find org.apache.jasper.servlet.JspServlet
2026-08-19 18:02:56.749 INFO (main) [] o.e.j.s.h.ContextHandler Started oeje10w.WebAppContext@85ec632{solr-jetty-context,/solr,b=file:///opt/solr-10.0.0/server/solr-webapp/webapp/,a=AVAILABLE,h=oeje10s.SessionHandler@1c05a54d{STARTED}}{/opt/solr-10.0.0/server/solr-webapp/webapp}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] Disable SVE when detecting Java version [solr]
Posted by "mpdude (via GitHub)" <gi...@apache.org>.
mpdude commented on PR #4765:
URL: https://github.com/apache/solr/pull/4765#issuecomment-5355716506
It's a virtual machine run by Parallels Desktop, that probably comes into play as well 🫤.
Either way, I'll improve the version parsing regex and hope that it's an acceptable change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] Disable SVE when detecting Java version [solr]
Posted by "mpdude (via GitHub)" <gi...@apache.org>.
mpdude commented on PR #4765:
URL: https://github.com/apache/solr/pull/4765#issuecomment-5355786545
Changed to lock to the first `version` line instead of using `head -1`; rebased, squashed and updated initial PR description.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] Disable SVE when detecting Java version [solr]
Posted by "mpdude (via GitHub)" <gi...@apache.org>.
mpdude commented on PR #4765:
URL: https://github.com/apache/solr/pull/4765#issuecomment-5410991527
I haven't actually run the changed script against different Java/JVM versions since I don't have them at hand.
However, AI researched a few typical `-version` outputs for me, and here is a bash script that verifies the updated `grep`/`awk` expression against those patterns.
Does that help?
```sh
#!/bin/bash
# Standalone test for the JAVA_VER_NUM extraction logic in solr/bin/solr (line ~178).
# Run: bash test-java-version-parsing.sh
set -u
extract() {
echo "$1" | grep -v '_OPTIONS' | awk -F '"' '/ version "/ {print $2; exit}' | sed -e's/^1\.//' | sed -e's/[._-].*$//'
}
pass=0
fail=0
check() {
local desc="$1" input="$2" expected="$3"
local actual
actual=$(extract "$input")
if [[ "$actual" == "$expected" ]]; then
printf 'PASS %-55s got %s\n' "$desc" "$actual"
pass=$((pass+1))
else
printf 'FAIL %-55s expected %s, got "%s"\n' "$desc" "$expected" "$actual"
fail=$((fail+1))
fi
}
check "Java 8, old 1.x scheme" \
'java version "1.8.0_412"
Java(TM) SE Runtime Environment (build 1.8.0_412-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.412-b08, mixed mode)' \
"8"
check "Java 11 OpenJDK (Temurin)" \
'openjdk version "11.0.24" 2024-07-16
OpenJDK Runtime Environment Temurin-11.0.24+8 (build 11.0.24+8)
OpenJDK 64-Bit Server VM Temurin-11.0.24+8 (build 11.0.24+8, mixed mode)' \
"11"
check "Java 17 IBM Semeru/OpenJ9 + JDK_JAVA_OPTIONS noise line" \
'picked up JDK_JAVA_OPTIONS: -Xshare:off
openjdk version "17.0.11" 2024-04-16
IBM Semeru Runtime Open Edition 17.0.11.0 (build 17.0.11+9)
Eclipse OpenJ9 VM 17.0.11.0 (build openj9-0.44.0, JRE 17 Linux amd64-64-Bit Compressed References 20240416_547)' \
"17"
check "Java 21 OpenJDK (Temurin, LTS)" \
'openjdk version "21.0.4" 2024-07-16 LTS
OpenJDK Runtime Environment Temurin-21.0.4+7 (build 21.0.4+7-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.4+7 (build 21.0.4+7-LTS, mixed mode, sharing)' \
"21"
check "Java 21 GraalVM" \
'java version "21.0.2" 2024-01-16
Java(TM) SE Runtime Environment Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30, mixed mode, sharing)' \
"21"
check "Java 25, SVE warning line BEFORE version line (this PR's bug report)" \
'OpenJDK 64-Bit Server VM warning: Unable to get SVE vector length on this system. Disabling SVE. Specify -XX:UseSVE=0 to shun this warning.
openjdk version "25.0.3" 2026-04-21 LTS
OpenJDK Runtime Environment Temurin-25.0.3+9 (build 25.0.3+9-LTS)
OpenJDK 64-Bit Server VM Temurin-25.0.3+9 (build 25.0.3+9-LTS, mixed mode, sharing)' \
"25"
echo
echo "For comparison, the OLD logic (head -1 | awk '/version/') on the SVE-warning case:"
old_result=$(echo 'OpenJDK 64-Bit Server VM warning: Unable to get SVE vector length on this system. Disabling SVE. Specify -XX:UseSVE=0 to shun this warning.
openjdk version "25.0.3" 2026-04-21 LTS' | grep -v '_OPTIONS' | head -1 | awk -F '"' '/version/ {print $2}' | sed -e's/^1\.//' | sed -e's/[._-].*$//')
echo " -> \"${old_result}\" (empty = the reported bug: JAVA_VER_NUM ends up blank)"
echo
echo "$pass passed, $fail failed"
[[ $fail -eq 0 ]]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] Disable SVE when detecting Java version [solr]
Posted by "risdenk (via GitHub)" <gi...@apache.org>.
risdenk commented on code in PR #4765:
URL: https://github.com/apache/solr/pull/4765#discussion_r3815839977
##########
solr/bin/solr:
##########
Review Comment:
I think we should just make this regex better instead?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org