开发者

IKVM Help - Cannot find class when creating dll

开发者 https://www.devze.com 2023-03-25 12:25 出处:网络
This is a follow up to this post where i have discovered how to interact with dll files that were generated from .jars via IKVM How to call a dll file from c#

This is a follow up to this post where i have discovered how to interact with dll files that were generated from .jars via IKVM How to call a dll file from c#

The application i have created in java works as a stand alone project. When i try and generate the dll file though i get ClassNotFound errors with the lib files i imported in to the project. To import (in eclipse)i created a lib folder, dumped the jar files inside, selected all of them and then right clicked -> add to build path.

Is there a fundamental step i am 开发者_运维知识库missing here or is it not possible to generate a dll file from a .jar that uses library files inside?

Thanks, and sorry for the confusion


It look like that you have mix some things. With IKVM there are 2 modes:

  1. Compiling to .NET on the fly. You use the ikvm.exe and it like a java.exe. If you want use it in eclipse then you need to rename ikvm.exe to java.exe. In this mode you can work only with jar files.

  2. Compiling to .NET on building. You use the ikvmc.exe to compile your your jar files to .NET dlls or a .NET exe. This dll can you use only with Visual Studio and not with Eclipse. It is not possible to import dll files in Eclipse. If you want access an existing .NET dll in Eclipse then you need to create stub jar files with ikvmstub.exe. If you do it you can not run it anymore with the Java from Oracle.

0

精彩评论

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

关注公众号