Hi Jie,

actually the Lucene 9.x series requires JDK 11 to run, previous versions also work with Java 8. The main branch is already on JDK 17. From my knowledge, you may only use Lucene versions up to 8 to have at least a chance to run it. But with older Android version you may even need to go back to Lucene builds targetting JDK 7 (Lucene 5 ?, don't know).

But this is only half of the story: Lucene actually uses many many modern JDK and JVM features that are partly not implemented in Dalvik. It uses MethodHandles instead of reflection and the Java 8+ version use lambdas which were not compatible with older Android SDKs.

So in short: Use older version and hope, but we offer no support or are not keen to apply changes to Lucene so it can be used with Android at all - because Android is not really compatible to any Java spec like API or memory model.

Uwe

Am 09.09.2022 um 09:10 schrieb Jie Wang:
Hey,

Recently, I am trying to compile the Lucene to get a jar that can be used in 
Android, but failed.

Is there an official version that supports the use of Lucene on Android?


Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

--
Uwe Schindler
Achterdiek 19, D-28357 Bremen
https://www.thetaphi.de
eMail: u...@thetaphi.de


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

Reply via email to