private void myFunction(String userName){
String fileName = this.generateFile(userName);
String[] command = new String[4];
command[0] = \"cmd\";
comm
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.
Try this:
final Runtime rt = Runtime.getRuntime();
rt.exec(your command line here as a single String);
At the risk of repeating myself I'm gonna say it again: java.lang.ProcessBuilder is much better option