문제

I want to add new process using ProcessBulder class in Java. But process name is taken from user input then how to set the path?

The user only enter the process name like firefox.exe, but it does not start directly, it throws PathNotFoundException. How can I identify the path of user's input? Or how should I start the process which entered by the user?

도움이 되었습니까?

해결책

It should be either full path or the program should be in a folder known to OS via PATH variable, or the program should be in working dir

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top