I'm writing a program that includes a feature where the user can type in Java code into a text box and be able to compile and run it. The error I get is: 
The two directories shown at the top are correct, and the command works when I do it manually through command prompt from the same working directory. I'm using Windows 10, and also here's the code:
public Process compile() throws IOException { save(); //saves changes to source file System.out.println(file.getCanonicalPath()); ProcessBuilder processBuilder = new ProcessBuilder("javac", file.getCanonicalPath()); processBuilder.directory(new File(settingsFile.getJdkPath())); System.out.println(processBuilder.directory()); Process process = processBuilder.start(); //Throws exception this.compiledFile = new File(file.getParentFile(), file.getName().replace(".java", ".class")); return process; } 

