简体   繁体   English

如何使用ProcessBulder为新流程设置用户输入的路径?

[英]How do I set the path from user input for a new process using ProcessBulder?

I want to add new process using ProcessBulder class in Java. 我想使用Java中的ProcessBulder类添加新流程。 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 . 用户仅输入进程名称(如firefox.exe ,但不会直接启动,而是抛出PathNotFoundException How can I identify the path of user's input? 如何确定用户输入的路径? Or how should I start the process which entered by the user? 或者我应该如何开始用户输入的过程?

它应该是完整路径,或者程序应该在OS通过PATH变量知道的文件夹中,或者程序应该在工作目录中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM