Mailing List Archive

Build Lucene9 with JDK8
Hi, Lucene Dev Community:

We'd love to leverage Lucene9's great features.
But unfortunately some of our internal systems could only work with JDK8
now.

So we're thinking of building L9 with JDK8.
I've briefly tried to just change the JDK versions in build.gradle and
gradlew, but it just doesn't work out.

So my questions are:
1. What are the features in L9 which strictly require JDK11?

2. Is it possible to build L9 with JDK8?
If possible (maybe just for some modules),
-- how to configure it to make the build work?
-- will there be any negative impact, e.g. performance reduction?


Thanks
MyCoy
Re: Build Lucene9 with JDK8 [ In reply to ]
Hi,

In short: You can't use Lucene 9 without Java 11, sorry.

Am 19.05.2023 um 19:55 schrieb MyCoy Z:
> So we're thinking of building L9 with JDK8.
> I've briefly tried to just change the JDK versions in build.gradle and
> gradlew, but it just doesn't work out.
>
> So my questions are:
> 1. What are the features in L9 which strictly require JDK11?

Lucene 9 uses the Java Module System that was introduced with Java 9.
All code was changed to communicate with the Java 9 module system, so
many code parts won't compile because of this. Also the ServicePorvider
API to load codecs was changed to be module system compatible.

In addition for performance reasons Lucene Core already uses new Arrays
methods like mismatch() which are intrinsified by JVM (FYI, Lucene 8.x
has a Multi-Release JAR that automatically makes use of Java 9+
features, this backwards layer was removed in Lucene 9, so code won't
compile without having the new method signatures).

Finally, you would need to patch huge amounts of code, because it uses
the "var" keyword.

There may be more requirements, the above are the first ones I remember.

> 2. Is it possible to build L9 with JDK8?
>     If possible (maybe just for some modules),
>     -- how to configure it to make the build work?

No. Theres no way to do this by purely configuring the build. The Lucene
Core module heavily requires the above features (modules, Arrays, new
Mmap implementation, var keyword).

>     -- will there be any negative impact, e.g. performance reduction?

Yes for sure. Also MMapDirectory can't be used anymore as the Java 8
compatibility layer was removed. So MMapDirectory can't be used anymore.
This will slow down everything.

Uwe

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org