0

I used diff-match-patch dependency in my maven project.

<depencency>
    <groupId>org.bitbucket.cowwoc</groupId>
    <artifactId>diff-match-patch</artifactId>
    <version>1.2</version>
</dependency>

Then i created JAR of my project, tried to run, but its giving Exception:

exception in thread main java.lang.NoClassDefFoundError : 
     org/bitbucket/cowwoc/diffmatchpatch/DiffMatchPatch
Caused by: java.lang.ClassNotFoundException: 
     org.bitbucket.cowwoc.diffmatchpatch.DiffMatchPatch

Running my jar using

java -cp FileComparison.jar com.abc.util.FileCompareLauncher
James Z
  • 12,209
  • 10
  • 24
  • 44
ritik jain
  • 540
  • 1
  • 5
  • 13
  • 1
    JAR files don't bundle dependencies, you need to either add them all to the class path, or create a shared JAR. Check out the Maven shade plugin for more information. – Rob Spoor Jan 21 '23 at 12:01

0 Answers0