uschindler commented on issue #12307:
URL: https://github.com/apache/lucene/issues/12307#issuecomment-1803320694

   Hi,
   this has nothing to do with the minimum Java version in your Java built, it 
only has to do with the runtime Java version. If you use Java 19 or later, the 
classloader needs to be able to find the version specific support classes for 
MemorySegment (foreign API) and Vector API in the JAR file, which it clearly 
says:
   
   Caused by: java.lang.ExceptionInInitializerError: Exception 
java.lang.LinkageError: MemorySegmentIndexInputProvider is missing in Lucene 
JAR file [in thread "main"]
   
   Lucene's JAR files are modularized (https://openjdk.org/jeps/261) MR-JAR 
(https://openjdk.org/jeps/238) files with service provider (SPI, 
https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/ServiceLoader.html).
   
   If you want to merge different JAR files and Lucene's JAR files are part of 
it, please read ALL the three specs above and then ensure the following:
   - All files in `META-INF/services` _with same name need to be merged 
together_ and placed in resulting JAR 
(https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/ServiceLoader.html)
   - All files in `META-INF/versions` need to be copied to resulting JAR with 
exactly same directory structure. Those files are the version specific classes 
and are only loaded depending on the Runtime JDK (https://openjdk.org/jeps/238).
   - META-INF/MANIFEST.MF must contain `Multi-Release: true` 
(https://openjdk.org/jeps/238).
   - All class files named `module-info.class` should be removed as the 
resulting JAR file is no longer modularized. Keeping them inside may fail to 
load the application in modularized runtime (https://openjdk.org/jeps/261).


-- 
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-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to