开发者

Reference jAVA dll from .Net 4.0 (c#)

开发者 https://www.devze.com 2023-03-20 12:37 出处:网络
I have in third party DLL which is written in Java and we need to register this DLL using regsvr32. After registering it generates .jar file. I did the registration of the DLL and i able to see the DL

I have in third party DLL which is written in Java and we need to register this DLL using regsvr32. After registering it generates .jar file. I did the registration of the DLL and i able to see the DLL when i do Add References >> COM tab. When i add that DLL using Add references its generates interop.DLLNAME.dll and all te class. My Problem is that when i tries to create and object from that class, application start throwing run-time exception say. Unable to cast _COMObject to Generated Class for my DLL

If someone did someth开发者_如何学Pythoning like above please suggest me. Or How can i take reference of DLL which is written in JAVA?


A DLL can strictly not be written in Java. What you mean, perhaps, is that a JVM is embedded in the DLL.

Using COM (Interop)

This seems to be what you're doing now (that has zero relation to Java). At the moment I don't have any immediate thoughts about the exception you mention

Using Java (IKVM)

That said, if you have a JAR file, you can use IKVM (Java to CLR bridge), see

  • http://www.ikvm.net
  • http://www.mono-project.com/Java
0

精彩评论

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