I need to execute jar file from java with following command.
java -jar test.jar >> /home/jarlogfile/test.log &
Its not working me. Cannot create test.log file in that location and process also end.
Coding:
public static void main(String ar[]){
ProcessBuilder process = new ProcessBuilder("java", "-jar", "/home/jar/test.jar", ">> /home/jarlogfile/test.log &");
Process p = process.start();
}
Help me.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.