开发者

java application as a Windows Service using C#

开发者 https://www.devze.com 2023-01-21 17:24 出处:网络
I would like to wrap a java application as a Windows Service using C#. I can do it easily using 开发者_如何学Pythonthe Process class and calling Process.Start(\"java.exe\", \"args\"), but doing this w

I would like to wrap a java application as a Windows Service using C#. I can do it easily using 开发者_如何学Pythonthe Process class and calling Process.Start("java.exe", "args"), but doing this way I have 2 process, my service wrapper and the java process. I'm looking to fully wrap the java application, including the java process.

Does anybody here has done it or knows the best way to do this in C#?


The two basic approaches are to either run the Java application as a separate process, or to host the JVM directly, and use it to launch your application. There isn't a direct way to do this in C#, as the JNI interfaces for hosting are C++ interfaces only.

However, there are commerical products that allow you to do this directly from Java.

0

精彩评论

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

关注公众号