Java Runtime.exec() arguments on Linux
问题 Okay so here is the problem: I have 3 classes MyClass1 and MyClass2 and ExecClass. I go to my command prompt and do this: $java MyClass1 -exec "java MyClass2 arg1 arg2" which works perfectly. Now in ExecClass I have the following line: Runtime.getRuntime().exec("java MyClass1 -exec \"java MyClass2 arg1 arg2\""); Problem is if you print the second string its exactly the same as the first, but when my ExecClass runs it MyClass1 complains: Unrecognized argument arg1 and fails. After a bit of