#Can't set maven.compiler.release to 21
1 messages · Page 1 of 1 (latest)
<@&987246554085740594> please have a look, thanks.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.tempestro</groupId>
<artifactId>robots</artifactId>
<version>1.0</version>
<name>Robots</name>
<properties>
<java.version>21</java.version>
<javafx.version>21</javafx.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>17</maven.compiler.release>
<maven.compiler.source>${maven.compiler.release}</maven.compiler.source>
<maven.compiler.target>${maven.compiler.release}</maven.compiler.target>
<maven.compiler.version>3.14.0</maven.compiler.version>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>${javafx.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<release>${java.version}</release>
</configuration>
</plugin>
```
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
<configuration>
<toolchains>
<jdk>
<version>${java.version}</version>
<vendor>openjdk</vendor>
</jdk>
</toolchains>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<executions>
<execution>
<id>default-cli</id>
<configuration>
<mainClass>com.tempestro.App</mainClass>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
The project compiles like this, with maven.compiler.release set to 17 (somehow? even though I'm using Java 21?) but setting it to 21 causes things to break, the compiler errors out claiming it can't find the modules javafx.controls and javafx.graphics. I've no clue what anything in this file does really, I've never worked with Java before.
Could someone explain what this file does and what's going on? Also while at it, am I doing something particularly egregious in the file?
do javafx.controls exist in v21?
maybe they were deprecated.
i dunno, i still use swing.
nvm, I managed to break it at one point and couldn't fix it no matter what, so I started anew and now it works
huh
I think what I had been missing was that I hadn't actually installed jdk21, just the JRE? I did that at some point, but in the combined mess of maven, me trying to mess around with toolchains at one point and idk what, it wasn't obvious what was going on
either way dropping toolchains seems to be the main difference
I was using that to get around, uh, something not working with java 21? presumably because I didn't even have it installed, lol?
I'm confused
either way, it werks now