Using fop and Java11 with Maven and Eclipse I can create PDF documents from an xsl-fo input.
But only if I start the program from within Eclipse.
My pom.xml advises Maven to copy all jar files used for dependencies, to a lib folder. Preparing to run from command line.
When I try to start the program from command line like
java -p target/rutil-0.0.1-SNAPSHOT.jar;target/lib -m eu.ngong.rutil/eu.ngong.rutil.App
I get this error:
Error occurred during initialization of boot layer java.lang.module.FindException: Unable to derive module descriptor for target\lib\batik-script-1.14.jar.
I can add exclusions to the fop dependency entry in pom.xml, but only to see the next failure message (same package in two modules) and so on.
How can I start my program from command line like Eclipse is doing?
My goal is to use fop in a nightly build batch run.
You may find an absolute minimal version of my program here.
You can put all your non modularised artifacts on the classpath and not support deriving their module information. These would be primarily treated as an unnamed module.
java --module-path target/rutil-0.0.1-SNAPSHOT.jar;target/lib/fop-2.6.jar \
--class-path target/lib \
--module eu.ngong.rutil/eu.ngong.rutil.App
I have provided an explanation in this answer to the error that you are facing. The immediate way to solve it while using all other artifacts on modulepath as well could be hacking the jar to remove the entry from the MANIFEST.MF
.