Edward Lovo
12/19/2024, 9:50 PM> Cannot choose between the available variants of org.openjfx:javafx-controls:23.0.1:
- linux-aarch64Runtime
- linuxRuntime
- mac-aarch64Runtime
- macRuntime
- runtime
- winRuntime
I have been at this all day and cannot figure out for the life of me what's going on. I have tried all kinds of things. My latest attempt includes running this bit of code in my build.gradle file in the hopes of pointing explicitly to the location of the JavaFX installation to avoid any ambiguity:
def javafxHome = System.getenv('JAVAFX_HOME')
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.fork = true
options.compilerArgs.addAll(['-Xlint:deprecation','-Xlint:unchecked','-Xlint:preview'])
options.compilerArgs.addAll(['--module-path',javafxHome+File.separator+'lib'])
sourceCompatibility='23'
targetCompatibility='23'
}
I have of course already added these plugins:
plugins {
id('java')
id("application")
id('idea')
id("com.github.johnrengelman.shadow") version "8.1.1"
id("io.micronaut.application") version "4.4.4"
id("com.google.protobuf") version "0.9.2"
id("org.openjfx.javafxplugin") version "0.1.0"
}
javafx {
version = "23.0.1"
modules = [ 'javafx.controls', 'javafx.graphics', 'javafx.base' ]
}
Is anyone able to shed any light on this? I am confounded.TheGoesen
12/19/2024, 9:55 PMEdward Lovo
12/19/2024, 10:08 PM[Incubating] Problems report is available at: file:///C:/Users/ealov/Downloads/ChatClient/build/reports/problems/problems-report.html
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':extractIncludeProto'.
> Could not resolve all files for configuration ':compileProtoPath'.
> Cannot resolve external dependency io.micronaut:micronaut-discovery-core because no repositories are defined.
Required by:
root project :
> Cannot resolve external dependency io.micronaut.grpc:micronaut-grpc-runtime because no repositories are defined.
Required by:
root project :
> Cannot resolve external dependency io.micronaut.grpc:micronaut-grpc-client-runtime because no repositories are defined.
Required by:
root project :
> Cannot resolve external dependency io.micronaut.serde:micronaut-serde-jackson because no repositories are defined.
Required by:
root project :
> Cannot resolve external dependency javax.annotation:javax.annotation-api because no repositories are defined.
Required by:
root project :
> Cannot resolve external dependency com.google.cloud.trace:java-timestamp:0.2.2 because no repositories are defined.
Required by:
root project :
> Cannot resolve external dependency io.micronaut:micronaut-inject because no repositories are defined.
Required by:
root project :
> Cannot resolve external dependency org.openjfx:javafx-base:23.0.1 because no repositories are defined.
Required by:
root project :
> Cannot resolve external dependency org.openjfx:javafx-graphics:23.0.1 because no repositories are defined.
Required by:
root project :
> Cannot resolve external dependency org.openjfx:javafx-controls:23.0.1 because no repositories are defined.
Required by:
root project :
> Cannot resolve external dependency io.micronaut.platform:micronaut-platform:4.7.2 because no repositories are defined.
Required by:
root project :
* 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.
> Get more help at <https://help.gradle.org>.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to <https://docs.gradle.org/8.11.1/userguide/command_line_interface.html#sec:command_line_warnings> in the Gradle documentation.
BUILD FAILED in 1s
Edward Lovo
12/19/2024, 10:08 PMTheGoesen
12/19/2024, 10:08 PMTheGoesen
12/19/2024, 10:09 PMTheGoesen
12/19/2024, 10:09 PMTheGoesen
12/19/2024, 10:12 PMTheGoesen
12/19/2024, 10:17 PMJendrik Johannes
12/19/2024, 10:26 PMcompileProtoPath
configuration to resolve the variant conflict.
Similar to what is done here for the normal classpaths:
https://github.com/openjfx/javafx-gradle-plugin/blob/master/src/main/java/org/openjfx/gradle/JavaFXOptions.java#L109-L114
Something like:
configurations.compileProtoPath {
attributes {
attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE,
objects.named(OperatingSystemFamily, javafx.platform.osFamily));
attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE,
objects.named(MachineArchitecture, javafx.platform.arch));
}
}
I think there is no shortcut for this in the javafx { }
block at the moment.TheGoesen
12/19/2024, 10:32 PMTheGoesen
12/19/2024, 10:43 PMJendrik Johannes
12/19/2024, 10:44 PMEdward Lovo
12/19/2024, 10:48 PM> Task :run FAILED
[Incubating] Problems report is available at: file:///C:/Users/ealov/Downloads/ChatClient/build/reports/problems/problems-report.html
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Could not resolve all files for configuration ':developmentRuntimeClasspath'.
> Could not resolve org.openjfx:javafx-base:23.0.1.
Required by:
root project :
> Cannot choose between the available variants of org.openjfx:javafx-base:23.0.1:
- linux-aarch64Runtime
- linuxRuntime
- mac-aarch64Runtime
- macRuntime
- runtime
- winRuntime
All of them match the consumer attributes:
- Variant 'linux-aarch64Runtime' capability 'org.openjfx:javafx-base:23.0.1':
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.native.architecture 'aarch64' but the consumer didn't ask for it
- Provides org.gradle.native.operatingSystem 'linux' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Variant 'linuxRuntime' capability 'org.openjfx:javafx-base:23.0.1':
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.native.architecture 'x86-64' but the consumer didn't ask for it
- Provides org.gradle.native.operatingSystem 'linux' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Variant 'mac-aarch64Runtime' capability 'org.openjfx:javafx-base:23.0.1':
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.native.architecture 'aarch64' but the consumer didn't ask for it
- Provides org.gradle.native.operatingSystem 'macos' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Variant 'macRuntime' capability 'org.openjfx:javafx-base:23.0.1':
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.native.architecture 'x86-64' but the consumer didn't ask for it
- Provides org.gradle.native.operatingSystem 'macos' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Variant 'runtime' capability 'org.openjfx:javafx-base:23.0.1':
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Variant 'winRuntime' capability 'org.openjfx:javafx-base:23.0.1':
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.native.architecture 'x86-64' but the consumer didn't ask for it
- Provides org.gradle.native.operatingSystem 'windows' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
> Could not resolve org.openjfx:javafx-graphics:23.0.1.
Required by:
root project :
> Cannot choose between the available variants of org.openjfx:javafx-graphics:23.0.1:
- linux-aarch64Runtime
- linuxRuntime
- mac-aarch64Runtime
- macRuntime
- runtime
- winRuntime
All of them match the consumer attributes:
- Variant 'linux-aarch64Runtime' capability 'org.openjfx:javafx-graphics:23.0.1':
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.native.architecture 'aarch64' but the consumer didn't ask for it
- Provides org.gradle.native.operatingSystem 'linux' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Variant 'linuxRuntime' capability 'org.openjfx:javafx-graphics:23.0.1':
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.native.architecture 'x86-64' but the consumer didn't ask for it
- Provides org.gradle.native.operatingSystem 'linux' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Variant 'mac-aarch64Runtime' capability 'org.openjfx:javafx-graphics:23.0.1':
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.native.architecture 'aarch64' but the consumer didn't ask for it
- Provides org.gradle.native.operatingSystem 'macos' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Variant 'macRuntime' capability 'org.openjfx:javafx-graphics:23.0.1':
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.native.architecture 'x86-64' but the consumer didn't ask for it
- Provides org.gradle.native.operatingSystem 'macos' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Variant 'runtime' capability 'org.openjfx:javafx-graphics:23.0.1':
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Variant 'winRuntime' capability 'org.openjfx:javafx-graphics:23.0.1':
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.native.architecture 'x86-64' but the consumer didn't ask for it
- Provides org.gradle.native.operatingSystem 'windows' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
Jendrik Johannes
12/19/2024, 10:49 PMdevelopmentRuntimeClasspath
is probably something out of the micronaut plugin. It makes more sense that that has JavaFX.
Still that one is "special". You should be able to apply what I posted to that one.Jendrik Johannes
12/19/2024, 10:50 PMconfigurations.developmentRuntimeClasspath {
attributes {
attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE,
objects.named(OperatingSystemFamily, javafx.platform.osFamily));
attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE,
objects.named(MachineArchitecture, javafx.platform.arch));
}
}
Jendrik Johannes
12/19/2024, 10:50 PMEdward Lovo
12/19/2024, 11:18 PM