How to get source dependencies from javac?
===

I have three source files: `X.java`, `A.java`, `B.java`. The class `X` uses the classes `A` and `B`. When I compile `X` with

    $ javac X.java

I get tree class files: `X.class`, `A.class`, `B.class`. `javac` analyzes the source of `X.java` and finds out that the classes `A` and `B` are used and compiles the matching source files automatically.

How can I tell `javac` to dump the dependencies without compiling the code?

I found [a hint in the web][1] about a `-xdepend` option but this [seems to be removed][2] from javac since 1.3.1. What is the preferred way to do this nowadays?

I am using:

    $ java -version
    java version "1.6.0_21"
    Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
    Java HotSpot(TM) Server VM (build 17.0-b16, mixed mode)


  [1]: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4162387
  [2]: http://mail-archives.apache.org/mod_mbox/ant-user/200201.mbox/%3COFF8107B69.ACEB3A1A-ON86256B37.00119A60@trilogy.com%3E