You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WARNINGs when executing analysis with Java 21 #7759
I can confirm this with the maven version as well.
Java version:
openjdk 21.0.7 2025-04-15
OpenJDK Runtime Environment (build 21.0.7+6)
OpenJDK 64-Bit Server VM (build 21.0.7+6, mixed mode, sharing)
Log:
[INFO] Finished Jar Analyzer (0 seconds)
[INFO] Finished Dependency Merging Analyzer (0 seconds)
[INFO] Finished Hint Analyzer (0 seconds)
[INFO] Finished Version Filter Analyzer (0 seconds)
WARNING: A restricted method in java.lang.foreign.Linker has been called
WARNING: java.lang.foreign.Linker::downcallHandle has been called by the unnamed module
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for this module
Jul 07, 2025 9:20:23 AM org.apache.lucene.store.MemorySegmentIndexInputProvider <init>
INFO: Using MemorySegmentIndexInput and native madvise support with Java 21 or later; to disable start with -Dorg.apache.lucene.store.MMapDirectory.enableMemorySegments=false
Jul 07, 2025 9:20:23 AM org.apache.lucene.internal.vectorization.VectorizationProvider lookup
WARNING: Java vector incubator module is not readable. For optimal vector performance, pass '--add-modules jdk.incubator.vector' to enable Vector API.
[INFO] Created CPE Index (1 seconds)
[INFO] Finished CPE Analyzer (4 seconds)
[INFO] Finished False Positive Analyzer (0 seconds)
[INFO] Finished NVD CVE Analyzer (0 seconds)
[INFO] Finished RetireJS Analyzer (0 seconds)
[INFO] Finished Vulnerability Suppression Analyzer (0 seconds)
[INFO] Finished Known Exploited Vulnerability Analyzer (0 seconds)
[INFO] Finished Dependency Bundling Analyzer (0 seconds)
IMHO, it's probably best to just add --enable-native-access=ALL-UNNAMED to the CLI args, but in the generic CLI (BYO JVM, non-Docker) it's a bit messy as this option was only added in Java 19+.
Activity
fabianfrz commentedon Jul 7, 2025
I can confirm this with the maven version as well.
Java version:
Log:
Maven version
chadlwilson commentedon Sep 26, 2025
The warnings will be different depending on whether you are using the Docker image, and which JVM vendor and version you're using.
I've cleaned up CLI warnings somewhat within #7979 however the JVM warnings will require a few more decisions.
They come from Apache Lucene, and the default use of
MemorySegments on Java 21+ which triggers the warnings.Options
-Dorg.apache.lucene.store.MMapDirectory.enableMemorySegments=false(goes back toByteBuffers)--enable-native-access=ALL-UNNAMEDto start-up JVM argschadlwilson commentedon Sep 26, 2025
IMHO, it's probably best to just add
--enable-native-access=ALL-UNNAMEDto the CLI args, but in the generic CLI (BYO JVM, non-Docker) it's a bit messy as this option was only added in Java 19+.