Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a Java window within a C# Application [duplicate]

Tags:

java

c#

window

I have been searching around to see if there was anyway to run a java executable within a c# program, but I cannot seem to work it out or were to begin.

like image 680
iwan jeffery Avatar asked Feb 15 '26 01:02

iwan jeffery


1 Answers

If you want to integrate a Java frame into a C# program, take a look at IKVM, that is :

an implementation of Java for Mono and the Microsoft .NET Framework.

otherwise you can simply call the java app packed into a jar file in this way :

        Process proc = new Process();  
        ProcessStartInfo startInfo = new ProcessStartInfo();  
        startInfo.Arguments = @"-jar javaapp.jar";  
        startInfo.FileName = "java";  
        proc.StartInfo = startInfo;  
        proc.Start(); 
like image 186
aleroot Avatar answered Feb 16 '26 14:02

aleroot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!