run c# code in java [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
开发者_JAVA百科Closed 7 years ago.
Improve this questionI have a code which is written in c#, how can I run it in java code??
Thanks
The ikvm project is a JVM written in .net - designed to allow Java and .net interoperability.
If it is a small chunk of code, I'd recommend rewriting it.
If it is a large chunk of code, I'd recommend:
- wrapping it as a command and running it using
System.exec()
, or - turning it into a service and making requests using HTTP, a common RPC protocol or plain sockets.
Only if neither of those approaches were technically feasible would I consider something like JNI or IKVM.
Take a look at JNBridgePro (www.jnbridge.com), which is specifically designed to tightly integrate .NET and Java code.
Disclosure: I work for JNBridge.
精彩评论