-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NoClassDefFoundError when including gcc as library #3934
Comments
I've been working on #3896 recently, and just pushed a pull request to try to fix this, but your specific issue wasn't on my radar when I was doing that. I just checked the generated copy of the unshaded jar that this patch will produce, and it includes <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.0.1-jre</version>
</dependency> which should satisfy what you're after? I'm not sure if this will solve your |
I wrote an SSCCE to try and clarify my issue. And I found both the problem and a solution. I was using It is a little unclear to me which library is responsible for what work. The |
The The I'm unfamiliar how htmlcompression works to truly tell the differences between the two. |
I rummaged through the source code of htmlcompressor to see what it actually did. The
All of that is inside GCC, so I could just copy that and delete the htmlcompressor dependency. I happen to need this library for other stuff so for now I'll keep it. The NoClassDefFoundError is really just caused by bad dependency management. The googlecode version of htmlcompressor doesn't explicitly list which version of GCC it can handle and doesn't include it by default. As far as I'm concerned you can close this issue. |
I've written a tool that adds gcc as a library in my tools fatjar. When running this tool I get NoClassDefFoundError's.
Initially the error was for a missing
LimitInputStream
. Which Google said is part of an old version of Guava. Looking at the pom on MavenCentral I saw no dependencies there. And to be absolutely sure I ranmvn dependency:tree
and found no transitive dependencies listed.Looking through the bazel build I found a list of dependencies:
LimitInputStream however is not in the jar:
I don't see version numbers in the bazel build so I don't know what I am supposed to add. I gave it a good guess for Guava, and for good measure I also added failureaccess.
Now it looks like it can find LimitInputStream, but dies with a new NoClassDefFoundError for JSSourceFile.
I checked, it is not in the jar:
$ unzip -l closure-compiler-v20220405.jar | grep JSSourceFile
. But it seems to be part of the closure compiler source code so I have no idea what to add now.How can I add gcc as a library and have everything I need to actually run it? FYI I'm trying to use the JS compressor.
The text was updated successfully, but these errors were encountered: