I used scala-compiler.jar to compile an embedded Scala program This scala program imports a class written using jni
- The code is as follows
class test{
def test(ctx: ContractContext): ActionResult = {
val s = new DllTest
s.loadLibrary()
print(s.intMethod(5))
null
}
}
DllTest is a jni application
- The error is as follows
error: error while loading Object, Missing dependency 'object scala.native in compiler mirror', required by /modules/java.base/java/lang/Object.class
Failed to initialize compiler: object scala in compiler mirror not found.
** Note that as of 2.8 scala does not assume use of the java classpath.
** For the old behavior pass -usejavacp to scala, or if using a Settings
** object programmatically, settings.usejavacp.value = true.
Anyone knows the reason? And how to solve the problem? Thanks for shedding some lights on it
It works fine in the main function
def main(args: Array[String]): Unit = {
//Create system instance
val s = new DllTest
s.loadLibrary()
print(s.intMethod(5))
......