2

I have a large Java library but only need a small portion of it. How would I extract one (or more) class(es) that I want to use directly, plus all of its/their dependencies?

(An automated solution would be preferred, but I can also live with something that generates a list of files I need to manually extract).

This is a re-submission of How do I extract a single class plus all its dependencies from a library? from 2011. The answer from 2011 no longer works (at least, not with java 8).

sesquipedalias
  • 183
  • 2
  • 10
  • Are you using maven, gradle, or nothing? Do you want to extract them from the jar/war/ear archive? What IDE you want to use? – Sterconium Sep 20 '19 at 14:19
  • I was hoping for a tool that would analyse the source files themselves--and that would presumably be the most general tool, too. But I _am_ using maven; and I don't want to extract .class files from a .jar, I need to work with the source code. Thanks. – sesquipedalias Sep 20 '19 at 14:29
  • So, given a bunch of .java files it must return the minimal subset of .java required to compile one or more of them? – Sterconium Sep 20 '19 at 14:31
  • Is there any solution that works for java 8 ? – Francisco Javier Rojas May 05 '20 at 13:33

0 Answers0