My problem is when to call jar file using
Runtime.getRuntime().exec() method, my .jar is not executing and showing its output
Coding is like that
public static void main(String[] args) {
String execJar = "java -jar C:\test.jar"; try { Process p = Runtime.getRuntime().exec(execJar); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
When I used this "java -jar C:\test.jar" in command prompt, my .jar is not executing thus not showing System.out output. Does anybody know how I can make this work?
Thanks.