You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gradle 8.7 detects that the /usr/bin/jvm/openjdk- directory does not contain a java command and decides this is fatal error and that it can not continue. gradle resists strenuous efforts, some of which require root access, to fix this problem
Expected Behavior
gradle should notice there is no java and silently bypass that directory., which contains a src.zip flie which multiple architectures can share on Debian systems. java, javac, etc can be found in a java--openjdk- directory, for example java 1.7 tools can be found in usr/lib/jvm/java-17-openjdk-amd64 on my x86 64 systems.
A fallback method which is easy to reach and prioritises "works" over smart features would be a really useful feature. I appreciate it might not be a priority and require invasive changes in lots of places.
Suggested partial fix, which at least covers ./gradlew javaToolchains for me modulo some cosmetic issues:
---gradle-8.7-dist/src/jvm-services/org/gradle/jvm/toolchain/internal/FileBasedInstallationFactory.java 1980-02-01 00:00:00.000000000 +0000
+++ gradle-8.7/src/jvm-services/org/gradle/jvm/toolchain/internal/FileBasedInstallationFactory.java 2024-04-23 16:48:25.349948591 +0100
@@ -30,10 +30,14 @@
if (javaCandidates == null) {
return Collections.emptySet();
}
+ /* On Debian, and maybe some other systems, just a directory
+ * is insufficient so check for java instead. */
+ final String java = "bin" + File.seperator + "java";
return Stream.of(javaCandidates)
- .filter(File::isDirectory)
+ .filter(d -> new File(d, java).isFile())
.map(d -> new InstallationLocation(d, supplierName))
.collect(toSet());
}
}
Context (optional)
I encountered this trying to build something using a current version of java, which would ideally be java 23, which uses gradle features which the debian version does not support. This only cost me a whole week of discovering gradle not only gets it wrong bit also insists on getting it wrong.
Steps to Reproduce
Try to do a grade build on a current debian multiple architecture system. The debian version has a fix for this issue but can;t be used to build gradle 8.7.
Gradle version
8.7
Build scan URL (optional)
No response
Your Environment (optional)
No response
The text was updated successfully, but these errors were encountered:
We appreciate the effort, but we must ask for more information so that we can triage it.
We do not see an immediate root cause, and we need a minimal reproducible example for the triage. If we have a reproducer, we may be able also to suggest workarounds or ways to avoid the problem.
Probably you hit some corner case. Ideally, you can setup GitHub Action in our reproducer template to capture all the details. If it's very hard, then please provide at least a full log with stacktrace of your build failure.
While we asked for a reproducer, none was provided. If you provide a valid reproducer, we will consider this issue again. In the meantime, closing as unreproducible.
Current Behavior
gradle 8.7 detects that the /usr/bin/jvm/openjdk- directory does not contain a java command and decides this is fatal error and that it can not continue. gradle resists strenuous efforts, some of which require root access, to fix this problem
Expected Behavior
gradle should notice there is no java and silently bypass that directory., which contains a src.zip flie which multiple architectures can share on Debian systems. java, javac, etc can be found in a java--openjdk- directory, for example java 1.7 tools can be found in usr/lib/jvm/java-17-openjdk-amd64 on my x86 64 systems.
A fallback method which is easy to reach and prioritises "works" over smart features would be a really useful feature. I appreciate it might not be a priority and require invasive changes in lots of places.
Suggested partial fix, which at least covers ./gradlew javaToolchains for me modulo some cosmetic issues:
Context (optional)
I encountered this trying to build something using a current version of java, which would ideally be java 23, which uses gradle features which the debian version does not support. This only cost me a whole week of discovering gradle not only gets it wrong bit also insists on getting it wrong.
Steps to Reproduce
Try to do a grade build on a current debian multiple architecture system. The debian version has a fix for this issue but can;t be used to build gradle 8.7.
Gradle version
8.7
Build scan URL (optional)
No response
Your Environment (optional)
No response
The text was updated successfully, but these errors were encountered: