My problem is with compiling a C ++ file in java. I tried to execute C #, this is normal. This extraction code to compile C #
ProcessBuilder launcher = new ProcessBuilder("gmcs","HelloWorld.cs");`
However, my code is for C ++
ProcessBuilder launcher =new ProcessBuilder("g++", "HelloWorld.cpp -o HelloWorld");
returns error = 2, There is no such file or directory To indicate the path that I used launcher.directory(new File(path)) in both cases
source share