
Maybe the best option to use in a first analysis of any project is -summary or -s, which only shows dependencies between JARs and leaves out the package dependencies. There are various ways to configure JDeps' output. This makes the output all the more overwhelming, though, so it is high time to look into how we can make sense from so much data. The following module/JAR and package dependencies are like before but now all are found, so there are much more of them. In this specific case the output begins with a few split package warnings that I'm going to ignore for now. $ jdeps -class-path 'libs/*' -recursive sh-2.6.3.jar To include Scaffold Hunter's dependencies, I execute JDeps with -class-path 'libs/*' and -recursive:

To actually analyze the dependencies as well you need to make JDeps recurse into them with -recursive or -R. That enables JDeps to follow the paths into your dependencies' JARs and rids you of the not found indicators. ▚Including DependenciesĪn important aspect of JDeps is that it allows you to analyze your dependencies as if they were part of your code.Ī first step to that goal is putting them onto the class path with -class-path. Now it's time to configure JDeps with the various options. Note that some dependencies are marked as not found, which makes sense as I did not tell JDeps where to look for them. This is followed by the long list of package dependencies, which is a little too much to take in. You can see that Scaffold Hunter depends on the modules java.base (of course), sktop (it's a Swing application), java.sql (data sets are stored in SQL data bases), and a few others. That is followed by a list of package-level dependencies, which is organized as - >.Ĭalling jdeps sh-2.6.3.jar results in the following output:Įdu.udo.sh - > not foundĮdu.udo.sh - > .data sh-2.6.3.jarĮdu.udo.sh - > .gui sh-2.6.3.jarĮdu.udo.sh - > .gui.util sh-2.6.3.jarĮdu.udo.sh - > .util sh-2.6.3.jar
JAV LIBRARY HUNTER CODE
Used without further command line options it will first list the JDK modules the code depends on. Next step is to grab a JAR and set JDeps loose on it. Make sure that jdeps -version works and shows that the Java 9 version is running. Working with it is easiest if it is available on the command line, for which you might have to perform some setup steps specific to your operating systems. You can find the JDeps executable jdeps in your JDK's bin folder since Java 8. When showing output, I abbreviate scaffoldhunter (in package names) and scaffold-hunter (in file names) to sh to make it shorter.
JAV LIBRARY HUNTER ZIP
I downloaded the 2.6.3 release ZIP and copied all dependencies into libs. graph, dendrogram, and plot view, as well as analysis methods, e.g. Scaffold Hunter is a Java-based open source tool for the visual analysis of data sets with a focus on data from the life sciences, aiming at an intuitive access to large and complex data sets. With Gradle, you can use a Copy task, setting from to pile or ntime.Īs my sample project I picked Scaffold Hunter:

If you're using Maven, you can achieve the latter with the maven-dependency-plugin's copy-dependencies goal. It will be easiest if you have a JAR of your project and next to it a folder with all its transitive dependencies.

▚Code Alongįor this tutorial, I encourage you to follow along, preferably with one of your projects. In this tutorial, I'll introduce you to how JDeps works - follow-up posts will show you some great use cases for it. JDeps can also tell you which JDK-internal APIs your project is using and is fully aware of the module system.Īll in all it is a very useful tool to examine various forms of dependency graphs. The results can be filtered in various ways and can be aggregated to package or JAR level. class files or the JARs that contain them, and analyzes the statically declared dependencies between classes. JDeps is the Java Dependency Analysis Tool, a command line tool that processes Java bytecode, meaning.
