I am trying to use google-diff-match-patch, getting a NoClassDefFoundError on diff_match_patch$Diff when I run the following code.
import name.fraser.neil.plaintext.diff_match_patch.Diff;
import name.fraser.neil.plaintext.diff_match_patch.LinesToCharsResult;
import name.fraser.neil.plaintext.diff_match_patch.Patch;
...
public static void difftest(){
String string1 = "My first string";
String string2 = "My second string";
diff_match_patch dmp = new diff_match_patch();
LinkedList<Diff> diffs= dmp.diff_main(string1, string2);
String html = dmp.diff_prettyHtml( diffs);
System.out.println(html);
}
I've looked at the compiled diff_match_patch.class and diff_match_patch$Diff, diff_match_patch$Patch, and diff_match_patch$LinesToCharsResult are all there. I've never had much luck with static nested classes, but I think that's where the problem is.
I was using a Makefile to construct the jar I'm using, and I needed to include the nested classes in the jar