Mailing List Archive

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
RE: Unable to build lucene-9 with JDK-16.0.1 & Gradle 7.1.1 [ In reply to ]
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: uwe@thetaphi.de



From: balmukund mandal <bmmukund@gmail.com>
Sent: Tuesday, July 13, 2021 11:36 AM
To: dev@lucene.apache.org; dev-subscribe@lucene.apache.org
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
RE: Unable to build lucene-9 with JDK-16.0.1 & Gradle 7.1.1 [ In reply to ]
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: uwe@thetaphi.de



From: Uwe Schindler <uwe@thetaphi.de>
Sent: Tuesday, July 13, 2021 1:14 PM
To: dev@lucene.apache.org
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: uwe@thetaphi.de <mailto:uwe@thetaphi.de>



From: balmukund mandal <bmmukund@gmail.com <mailto:bmmukund@gmail.com> >
Sent: Tuesday, July 13, 2021 11:36 AM
To: dev@lucene.apache.org <mailto:dev@lucene.apache.org> ; dev-subscribe@lucene.apache.org <mailto:dev-subscribe@lucene.apache.org>
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
Re: Unable to build lucene-9 with JDK-16.0.1 & Gradle 7.1.1 [ In reply to ]
Hi Uwe,
Thank you very much for your kind suggestions. I'm able to build with this
combinations.

Thanks & Regards,
Balmukund


On Tue, Jul 13, 2021 at 4:43 PM Uwe Schindler <uwe@thetaphi.de> wrote:

> 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
>
> eMail: uwe@thetaphi.de
>
>
>
> *From:* balmukund mandal <bmmukund@gmail.com>
> *Sent:* Tuesday, July 13, 2021 11:36 AM
> *To:* dev@lucene.apache.org; dev-subscribe@lucene.apache.org
> *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
>
Re: Unable to build lucene-9 with JDK-16.0.1 & Gradle 7.1.1 [ In reply to ]
Hi Uwe,
It looks like lucene-9 has been built upon JDK-16/17 with an incubator
module. But when i'm trying the same for "--add-modules
jdk.incubator.vector" which is added as an org.gradle.jvmargs in
gradle.properties, it ends up below build error.

Error occurred during initialization of boot layer
java.lang.module.FindException: Module jdk.incubator.vector not found

Any suggestions would be really helpful.

Thanks & Regards,
Balmukund

On Tue, Jul 13, 2021 at 4:54 PM Uwe Schindler <uwe@thetaphi.de> wrote:

> 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
>
> eMail: uwe@thetaphi.de
>
>
>
> *From:* Uwe Schindler <uwe@thetaphi.de>
> *Sent:* Tuesday, July 13, 2021 1:14 PM
> *To:* dev@lucene.apache.org
> *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
>
> eMail: uwe@thetaphi.de
>
>
>
> *From:* balmukund mandal <bmmukund@gmail.com>
> *Sent:* Tuesday, July 13, 2021 11:36 AM
> *To:* dev@lucene.apache.org; dev-subscribe@lucene.apache.org
> *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
>
Re: Unable to build lucene-9 with JDK-16.0.1 & Gradle 7.1.1 [ In reply to ]
Hi Uwe,
I further tried few points as per your
https://github.com/apache/lucene/pull/177/ and added javac.gradle file
changes,that solved my above problem but still it unables to recognize
any classes from jdk.incubator.vector package and throwing following errors.

What I added under javac.gradle

configure(project(":lucene:core")) {
plugins.withType(JavaPlugin) {
tasks.named('compileJava').configure {
sourceCompatibility = 17
targetCompatibility = 17
options.compilerArgs += ["--release", 17 as String, "--add-modules",
"jdk.incubator.vector"]
options.compilerArgs -= "-Werror"
}
}
}

Following is the error, I got during build
./gradlew assemble

> Task :lucene:core:renderSiteJavadoc
error: cannot find symbol
*private static final VectorSpecies<Long> SPECIES =
LongVector.SPECIES_PREFERRED;*
^
symbol: class VectorSpecies
error: package jdk.incubator.vector does not exist
*import jdk.incubator.vector.*;*
^
2 errors

Any help will be really appreciated.

Thanks & Regards,
Balmukund


On Wed, Jul 14, 2021 at 7:41 AM balmukund mandal <bmmukund@gmail.com> wrote:

> Hi Uwe,
> It looks like lucene-9 has been built upon JDK-16/17 with an incubator
> module. But when i'm trying the same for "--add-modules
> jdk.incubator.vector" which is added as an org.gradle.jvmargs in
> gradle.properties, it ends up below build error.
>
> Error occurred during initialization of boot layer
> java.lang.module.FindException: Module jdk.incubator.vector not found
>
> Any suggestions would be really helpful.
>
> Thanks & Regards,
> Balmukund
>
> On Tue, Jul 13, 2021 at 4:54 PM Uwe Schindler <uwe@thetaphi.de> wrote:
>
>> 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
>>
>> eMail: uwe@thetaphi.de
>>
>>
>>
>> *From:* Uwe Schindler <uwe@thetaphi.de>
>> *Sent:* Tuesday, July 13, 2021 1:14 PM
>> *To:* dev@lucene.apache.org
>> *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
>>
>> eMail: uwe@thetaphi.de
>>
>>
>>
>> *From:* balmukund mandal <bmmukund@gmail.com>
>> *Sent:* Tuesday, July 13, 2021 11:36 AM
>> *To:* dev@lucene.apache.org; dev-subscribe@lucene.apache.org
>> *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
>>
>