Conversion of jar to dll using ikvm

梦想与她 提交于 2019-12-18 01:17:08

问题


I am trying to convert a jar into dll in dotnet using IKVM but am getting this error Exception in thread "main" java.lang.ClassNotFoundException: \Location of the jar\...

CAn anyone provide some guidance..

Thanks in advance


回答1:


Prerequisites -

  1. You must have the JDK installed on your system.
  2. Set the environment variables for the JDK.

Steps:

  1. Open the command prompt.
  2. Go to the ikvmc folder (ikvmc.exe comes with the ikvm package).
  3. Enter the command ikvmc -out:myapp.dll myapp.jar



回答2:


First, create a new Bindings Library project. In Xamarin Studio or Visual Studio, create a new Solution and select the Android Bindings Library template.

The template includes a Jars folder where you add your .JAR(s) to the Bindings Library project. Right-click the Jars folder and select Add > Existing Item:

Navigate to the .jar file downloaded earlier, select it and click Add:

Verify that the .jar file was successfully added to the project:

right click your jar file=>properities =>choose embedded jar

Set the build action to EmbeddedJar:

EmbeddedJar – the .JAR will be embedded in the Bindings Library.

Set the target API level for your Bindings Library

Finally, build the Bindings Library. Although some warning messages may be displayed, the Bindings Library project should build successfully and produce an output .DLL at the following location:

Projectname/bin/Debug/JarBinding.dll

Reference

https://developer.xamarin.com/guides/android/advanced_topics/binding-a-java-library/binding-a-jar/




回答3:


Is it possible that you forgot reference all needed IKVM .Net dlls?

IKVM.Runtime.dll IKVM.Reflection.dll IKVM.OpenJDK.*.dll

I've got something similar with SmsLib .Net version




回答4:


The follow wiki pages should be helpful:

  • http://sourceforge.net/apps/mediawiki/ikvm/index.php?title=ClassLoader
  • http://sourceforge.net/apps/mediawiki/ikvm/index.php?title=Ikvmc
  • http://sourceforge.net/apps/mediawiki/ikvm/index.php?title=Ikvmc_messages


来源:https://stackoverflow.com/questions/5335495/conversion-of-jar-to-dll-using-ikvm

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