Setting CLASSPATH during runtime

前端 未结 2 1587
忘掉有多难
忘掉有多难 2020-12-11 09:18

How do I set a CLASSPATH variable during runtime while using IKVM?

I\'ve been trying to do it by using: java.lang.System.setProperty(\"java.class.path\", \"wh

2条回答
  •  执念已碎
    2020-12-11 09:41

    I was trying to do the same thing. I had some jar files compiled to a .Net dll but some of those (3rd party) jar files were trying to load their configuration files from the java classpath.

    I solved the problem by specifying the -classloader option for the ikvmc tool. Example:

    ikvmc -out:mydotnetapp.dll -classloader:ikvm.runtime.ClassPathAssemblyClassLoader c:/myjavaapp/lib/*.jar
    

    This worked for me!

    Source for the solution: http://old.nabble.com/Not-able-to-load-files-from-ClassPath-td31141788.html

提交回复
热议问题