jdeps is a tool that can be used to analyze the dependencies of a jar file and generate a list of the modules that are needed to run the application.
jlink is a tool that can be used to create a custom runtime image that contains only the modules that are needed to run your application.