I've seen https://docs.oracle.com/en/java/javase/11/tools/jdeps.html but that only shows the command line options and doesn't document *how* to use it. How to interpret the output etc.
I've tried it on my project and I can't get it to work in a way I understand. Sometimes I can't get it to work at all. For example:
jdeps -cp jaxb-api-2.4.0-b180830.0359.jar MyApplication.jar
Error: jaxb-api-2.4.0-b180830.0359.jar is a multi-release jar file but --multi-release option is not set
jdeps --multi-release 9 -cp jaxb-api-2.4.0-b180830.0359.jar MyApplication.jar
Error: KayakPluginsRepoClientGui-2.1.2-SNAPSHOT.jar is not a multi-release jar file but --multi-release option is set
Well make up your mind jdeps!! How is that second "error" even an error? So what if my jar isn't multi-release. I've told you what release to assume IF you encounter a multi-release jar. If a jar isn't multi-release how is that a problem?
In other cases I'm trying to get jdeps --list-deps to produce a list of modules so I can build an appropriate runtime with jlink. My application is NOT modular. My application uses JavaFX and I am developing with JDK 11 so JavaFX is not part of the JDK.
If I do this:
jdeps --list-deps MyApplication.jar
java.base
java.datatransfer
java.desktop
java.logging
java.prefs
jdk.jsobject
You will notice that javafx modules are not listed and there is no indication that there is anything missing. This isn't too surprising, since jdeps hasn't been told where to find the JavaFX modules. However, even if I add them using --module-path the output still doesn't show any JavaFX modules:
jdeps --list-deps --module-path javafx-fxml-11.0.1-win.jar;javafx-controls-11.0.1-win.jar;;javafx-controls-11.0.1.jar;javafx-swing-11.0.1-win.jar;javafx-graphics-11.0.1-win.jar;javafx-graphics-11.0.1.jar;javafx-base-11.0.1-win.jar;javafx-base-11.0.1.jar MyApplication.jar
java.base
java.datatransfer
java.desktop/java.awt.dnd.peer
java.desktop/sun.awt
java.desktop/sun.awt.dnd
java.desktop/sun.swing
java.logging
java.prefs
java.scripting
java.xml
jdk.jsobject
jdk.unsupported
jdk.unsupported.desktop
Though now it is aware of additional modules from the JDK, and it is being more specific about packages in java.desktop (though I don't know why). Curiously, if I build a runtme image with jlink that contains the JavaFX modules and use:
jdeps --system my_custom_runtime --list-deps MyApplication.jar
java.base
java.datatransfer
java.desktop
java.logging
java.prefs
javafx.base
javafx.controls
javafx.fxml
javafx.graphics
javafx.web
jdk.jsobject
Now the JavaFX modules are shown.
What is different about including the modules in a runtime and using --system vs. adding them to the module path?
Where is this stuff documented?