I have a jar file, for example foo.jar. My code contains a lot of libraries (almost 75 jar dependencies). I am not using anything like maven or gradle, I'm just using pure java with pure jar files as dependencies, and I am working on my project in IntelliJ Idea. I used the IDE's artifacts system to turn my code into foo.jar. All the jar dependencies are compressed into this jar file. I am barely using much code from any of the libraries, yet the whole library jar is in my final jar.
Is there a way to strip out everything from the jar that is not being used by the code? (Right now it weighs almost whole 2gbs)