How To Open Applications With a Simple Java Code

How To Open Applications With a Simple Java Code


Explained YouTube video link : https://youtu.be/-RW2iC2UmNo

Below is a simple code which can open chrome browser .
you can replace the path with any applications path that you need to open.


public class OpenApp 
{
public static void main(String[] args) 
{
String s[]=new String[] {"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"};
try
{
Runtime runtime = Runtime.getRuntime();
runtime.exec(s);
}
catch(Exception e)
{
System.out.println(e);
}
}
}




Popular Posts