For an example how to build a custom version of Lucene with new incubating APIs from JDK 17, check here:
https://github.com/apache/lucene/pull/177 It also has the description mentioned in my earlier mail (RUNTIME_JAVA_HOME) and other changes of build system to use new APIs for evaluation. Uwe ----- Uwe Schindler Achterdiek 19, D-28357 Bremen <https://www.thetaphi.de> https://www.thetaphi.de eMail: [email protected] From: Uwe Schindler <[email protected]> Sent: Tuesday, July 13, 2021 1:14 PM To: [email protected] Subject: RE: Unable to build lucene-9 with JDK-16.0.1 & Gradle 7.1.1 Hi, you can only build Lucene with the shipped “gradlew”, not an arbitrary Gradle version: $ ./gradlew assemble To build Lucene and test on later Java versions, you need two JDKs installed and set environment variables. JAVA_HOME must point to JDK 11 RUNTIME_JAVA_HOME can point to anything (e.g. 16 or 17). By this Gradle runs with a supported environment for gradle, but compilation, tests,… are executed in the RUNTIME_JAVA_HOME. Uwe ----- Uwe Schindler Achterdiek 19, D-28357 Bremen <https://www.thetaphi.de> https://www.thetaphi.de eMail: [email protected] <mailto:[email protected]> From: balmukund mandal <[email protected] <mailto:[email protected]> > Sent: Tuesday, July 13, 2021 11:36 AM To: [email protected] <mailto:[email protected]> ; [email protected] <mailto:[email protected]> Subject: Unable to build lucene-9 with JDK-16.0.1 & Gradle 7.1.1 Dear Lucene Team, I'm unable to build lucene-9 with JDK-16.0.1 & Gradle 7.1.1. Please find below errors. Could not compile script '/home/lucene/lucene_9/lucene/gradle/testing/alternative-jdk-support.gradle'. > startup failed: script '/home/lucene/lucene_9/lucene/gradle/testing/alternative-jdk-support.gradle': 21: unable to resolve class JavaInstallationRegistry @ line 21, column 26. JavaInstallationRegistry registry = extensions.getByType(JavaInstallationRegistry) ^ script '/home/lucene/lucene_9/lucene/gradle/testing/alternative-jdk-support.gradle': 23: unable to resolve class JavaInstallation @ line 23, column 18. JavaInstallation currentJvm = registry.installationForCurrentVirtualMachine.get() ^ script '/home/lucene/lucene_9/lucene/gradle/testing/alternative-jdk-support.gradle': 25: unable to resolve class JavaInstallation @ line 25, column 18. JavaInstallation altJvm = { ^ 3 errors * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ============================================================================== 2: Task failed with an exception. ----------- * Where: Script '/home/lucene/lucene_9/lucene/gradle/java/javac.gradle' line: 69 * What went wrong: A problem occurred evaluating project ':lucene:backward-codecs'. > Failed to apply plugin class 'org.gradle.api.plugins.JavaPlugin'. > Could not get unknown property 'runtimeJavaVersion' for root project 'lucene-root' of type org.gradle.api.Project. Any suggestions would be really very helpful. Thanks & Regards, Balmukund
