Java classes can't get the resources in JAR files that compiled with IKVM

我们两清 提交于 2019-12-06 08:47:32

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

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 }

So, all jars merged with this one line of command. Although I don't have to use ILMerge anymore. There isn't any explanation about "sharedclassloader" in ikvmc help page. I found this explanation in this page.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!