title: How to use jdeps to analysis dependency of a fat jar(spring-boot)?
body: <p>The fat jar works well and I just want to use a cropped JRE.<br>
  I tried with following:</p>
  
  <pre><code>jdeps --list-deps {my fat jar}
  </code></pre>
  
  <p>The result I got is:</p>
  
  <pre><code>java.base
  java.logging
  </code></pre>
  
  <p>If I use that to make my own JRE using <code>jlink --no-header-files --no-man-pages --compress=2 --strip-debug --add-modules java.base,java.logging --output cropped-jre</code>, the new JRE just can't satisify the fat jar.<br>
  Actually, it needs other dependencies as well as "java.sql" for example.<br>
  The tree view of the fat jar is:</p>
  
  <pre><code>jar tf {my fat jar}
  META-INF/
  META-INF/MANIFEST.MF
  org/
  org/springframework/
  org/springframework/boot/
  ......
  BOOT-INF/
  BOOT-INF/classes/
  BOOT-INF/classes/templates/
  BOOT-INF/lib/{spring/netty/etc.jar}
  ......
  </code></pre>
  
  <p>How can I got all those dependency with jdeps?<br></p>
  
  <p>When you try to avoid this, you may try to unzip your fat jar and point it's lib to jdeps, but then you'll encounter another bug --<a href="https://bugs.openjdk.java.net/browse/JDK-8207162" rel="nofollow noreferrer">https://bugs.openjdk.java.net/browse/JDK-8207162</a>, which prevents you from using multi-version jars(such as log4j) with jdeps. Finally I tried every dependency to find an answer:
  jlink --no-header-files --no-man-pages --compress=2 --strip-debug --add-modules java.base,java.logging,java.management,java.sql,java.transaction.xa,java.xml,java.naming,java.desktop,java.security.jgss,java.instrument,jdk.unsupported --output java-base
  That will generate a cropped JRE(only 40MB, based on openJDK11) which could run your spring-boot application(with Tomcat/Thymeleaf/Jedis).</p>