How do I get a list of Java class dependencies for a main class?

前端 未结 5 1254
孤城傲影
孤城傲影 2020-12-16 20:06

Is there a way to find all the class dependencies of a java main class?

I have been manually sifting through the imports of the main class and it\'s imports but then

5条回答
  •  温柔的废话
    2020-12-16 20:09

    You may want to take a look at the jdeps command line tool:

    https://docs.oracle.com/javase/8/docs/technotes/tools/unix/jdeps.html

    jdeps -cp  -v 
    

    The command will return a list of the dependencies for that java class file. There are many other options that you can use in your command like -regex to find dependencies matching a given pattern

提交回复
热议问题