Java的类不能与IKVM编译的JAR文件中的资源 [英] Java classes can't get the resources in JAR files that compiled with IKVM

查看:395
本文介绍了Java的类不能与IKVM编译的JAR文件中的资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

推荐答案

我已经找到了解决方案。其实我发现,我做错了。首先,我已经转换的Java库这样的:

I've found the solution. Actually I've found where I did wrong. First I had converted java library like this:



    ikvmc first.jar -target:library -out:main.library.dll
    ikvmc second.jar -target:library -out:second.dll -r:main.library.dll
    ikvmc third.jar -target:library -out:third.dll -r:main.library.dll

然后我合并了所有这些DLL与ILMerge。这个问题是不是在合并的DLL。问题是在加载resorces。加载器的功能是在主库。第二和第三个库使用从主库这部分代码的功能。因此,加载函数仅检索它的JAR文件,该文件是first.jar。它不搜索其他罐子即使它们全部是在相同的合并的DLL。所以我改变了这样的我的转换脚本:

Then I had merged all these dlls with ILMerge. The problem wasn't in merging the dlls. The problem was in loading the resorces. The loader function is in main library. And the second and the third libraries use this loader function from main library. So the loader function searches for only its jar file that is first.jar. it doesn't search the other jars even if all of them is in the same merged dll. So I changed my convert script like this:



    ikvmc first.jar -target:library -out:merged.library.dll -sharedclassloader { second.jar } { third.jar }

因此​​,所有罐子合并这一行命令。虽然我没有使用ILMerge了。没有关于ikvmc帮助页sharedclassloader任何解释。我发现在此页面这样的解释。

这篇关于Java的类不能与IKVM编译的JAR文件中的资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆