Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top