问题
I need to use Java code in .NET (C#) and am looking for a way to convert a Java class to a DLL file (which I can then reference in my .NET app). Is this a valid scenario? If yes, How can I do it?
回答1:
You can use IKVM.NET to use Java classes and libraries from .NET.
回答2:
Basically that is not a good idea. Since java emphasizes on platform independence, but dll is platform dependent. So, think about pack into a jar file, execute and consume it somehow
May be this link will be useful for you:
http://www.codeproject.com/Articles/13549/Using-Java-Classes-in-your-NET-Application
回答3:
For this you can use IKVM.NET.
来源:https://stackoverflow.com/questions/15134961/convert-java-class-to-dll