开发者

Where does IKVM get its CLASSPATH from?

开发者 https://www.devze.com 2023-01-11 01:15 出处:网络
I have a .NET assembly that was converted from a jar file. This library looks for files in its classpath. I keep getting missing resource exceptions when running the application.开发者_运维技巧

I have a .NET assembly that was converted from a jar file. This library looks for files in its classpath. I keep getting missing resource exceptions when running the application.开发者_运维技巧

I have tried: - Putting the resource file in my bin folder - Putting the resource file in my source folder, including it in the VS project and setting copy local to on - setting a CLASSPATH environment variable to a folder containing the resource file

None of the above have worked. Does anyone know where IKVM expects to see its classpath or another way I can get my program to see the resource file?


According to the ikvm documentation, ikvm behaves similar to java. This should work:

ikvm -cp .;relative/path/to/jar/lib.jar com.example.MyClass

Got it - loading resources from the classpath does work in Java but not in the compiled .net assembly. The -resource parameter could be the one that does the trick but unfortunately there's no example on the ByteCode Compiler page.

Related question

  • Setting CLASSPATH during runtime
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号