google diff match修补程序在运行时失败,出现java.lang.NoClassDefFoundError

google diff match修补程序在运行时失败,出现java.lang.NoClassDefFoundError,java,google-diff-match-patch,Java,Google Diff Match Patch,我正在尝试使用,当我运行以下代码时,在diff_match_补丁$diff上得到一个NoClassDefFoundError 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;

我正在尝试使用,当我运行以下代码时,在diff_match_补丁$diff上得到一个NoClassDefFoundError

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);
}
import name.fraser.neil.plaintext.diff\u match\u patch.diff;
导入name.fraser.neil.plaintext.diff_match_patch.LinesToCharsResult;
导入name.fraser.neil.plaintext.diff_match_patch.patch;
...
公共静态无效测试(){
String string1=“我的第一个字符串”;
String string2=“我的第二个字符串”;
diff_match_patch dmp=新的diff_match_patch();
LinkedList diff=dmp.diff_main(string1、string2);
字符串html=dmp.diff_prettyHtml(diff);
System.out.println(html);
}

我已经看过编译的diff_match_patch.class和diff_match_patch$diff、diff_match_patch$patch和diff_match_patch$LinesToCharsResult都在那里。我从来没有在静态嵌套类方面有过太多的运气,但我认为这就是问题所在。

我正在使用一个Makefile来构造我正在使用的jar,我需要在jar中包含嵌套类

CLASSES = $(SRCS:.java=.class)  \
    diff_match_patch$$Diff.class \
    diff_match_patch$$Patch.class \
    diff_match_patch$$LinesToCharsResult.class \
    diff_match_patch$$Operation.class \
    diff_match_patch$$1.class