java.lang.IllegalArgumentException:运行jhindexer

时间:2018-01-14 21:38:12

标签: java ant java-8 javahelp

我需要使用JavaHelp包为我的应用程序生成一个帮助系统。我从github存储库下载了这个项目,我用GNU make工具和JDK 1.8上的Apache ant编译了它。我设法生成了我的帮助系统。

问题来自于使用jhindexer工具生成用于执行搜索的术语数据库。根据文档,只需在脚本中执行或直接执行jar jhindexer,然后指明.html文件所在的目录。

When executing the tool I get the following error:

 ~/Downloads: jhindexer JavaHelp
    Exception in thread "main" java.lang.IllegalArgumentException: URI is not hierarchical
        at java.io.File.<init>(File.java:418)
        at com.sun.java.help.search.RAFFileFactory.get(RAFFileFactory.java:87)
        at com.sun.java.help.search.BlockManager.<init>(BlockManager.java:87)
        at com.sun.java.help.search.BtreeDict.init(BtreeDict.java:212)
        at com.sun.java.help.search.FullBtreeDict.<init>(FullBtreeDict.java:343)
        at com.sun.java.help.search.DefaultIndexBuilder.<init>(DefaultIndexBuilder.java:79)
        at com.sun.java.help.search.Indexer.compile(Indexer.java:197)
        at com.sun.java.help.search.Indexer.main(Indexer.java:86)

错误发生在这一行,我试图进行更改,但我无法在最终编译中应用它们。

if (isFileURL(url)) {
    try {
    File f = new File(url.toURI());

    // refactor so it runs with verification on...

    // Object o = new FilePermission(f, update ? "write":"read");
    // here -- check if AccessController.checkPermission(p);

    result =  new RAFFile(f, update);
    debug ("Opened Dict file with file protocol:" +  f);
    } catch (SecurityException e) {
    // cannot do "it" -- code is not yet in place
    } catch (URISyntaxException x) {
        throw (IOException) new IOException(x.toString()).initCause(x);
    }

我已针对JDK 1.6进行编译,同样的错误也会发生。有谁知道我如何操作这个工具?非常感谢你。

0 个答案:

没有答案