Running Shell or System Command in JAVA

前端 未结 3 1011
执笔经年
执笔经年 2021-01-16 16:27
private void myFunction(String userName){
    String fileName = this.generateFile(userName);
    String[] command = new String[4];
    command[0] = \"cmd\";
    comm         


        
3条回答
  •  情歌与酒
    2021-01-16 17:12

    Your command is not in any of the directories in the PATH variable. And it is likely not in the "current working directory" of your Java programms process. Either set PATH correctly, or give the full absolute path to the command which you want to run.

提交回复
热议问题