Closed stweil closed 2 weeks ago
The commit fixes these build warnings:
WARNING system modules path not set in conjunction with -source 11
Please merge.
The commit fixes these build warnings:
WARNING system modules path not set in conjunction with -source 11
Please merge.
I did not see this warning in the CI runs nor on building on my local development system. Which version of Maven did you use? On CI Maven version 3.8.8 is in use (on my local system 3.8.7).
Compiling output did change from f.e.
[INFO] Compiling 384 source files with javac [debug:lines,vars,source target 11] to target/classes
to
[INFO] Compiling 384 source files with javac [debug:lines,vars,source release 11] to target/classes
It may have the same meaning and same binary result but it could even mean something different.
I have Apache Maven 3.8.7 (Debian bookworm).
I think it is a warning from the Java compiler, so it depends on the javac version (javac 17.0.11 in my case).
I think it is a warning from the Java compiler, so it depends on the Java version (openjdk 17.0.11 2024-04-16 in my case).
So far as I know there is currently no real support for Java versions greater then 11 in usage and even for compiling / building the application. Your fix should be applied at least on switching to Java 17 (or newer) as I don't know what are the consequences on using this right now with Java 11.
Related documentation: https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-release.html.
It may have the same meaning and same binary result but it could even mean something different.
It means the same , but "unlike the -source and -target options, the compiler will detect and generate an error when using APIs that don't exist in previous releases of Java SE". This is a desired additional meaning.
Your fix should be applied at least on switching to Java 17 (or newer) as I don't know what are the consequences on using this right now with Java 11.
It works since Java 9, so a Java 11 compiler fully supports it: "Starting JDK 9, the javac executable can accept the --release option to specify against which Java SE release you want to build the project".
@solth, please merge.
mvn clean dependency:analyze
und andere Aufrufe mit OpenJDK 22 Compiler erzeugt diese Warnungen:
[WARNING] Systemmodulpfad ist nicht zusammen mit -source 11 festgelegt
Wenn Sie den Speicherort der Systemmodule nicht festlegen, kann dies zu Klassendateien führen, die auf JDK 11 nicht ausgeführt werden können
--release 11 wird anstelle von -source 11 -target 11 empfohlen, weil dadurch der Speicherort der Systemmodule automatisch festgelegt wird
Die hier verwendete Konfiguration entspricht dem Hinweis in den Warnungen und wird seit JDK 9 unterstützt.
JDK 9 und JDK 11 erzeugen offenbar keine Warnungen, aber JDK 17 und JDK 22 geben den Warnungstext für jedes Modul von Kitodo.Production aus. Dieser Pull Request korrigiert das, funktioniert aber auch ohne Einschränkung mit JDK 11.
This fixes a lot of build warnings with Java compilers newer than version 11.
As the change is supported since Java 9, it also works with Java 11.