when compiling within a program. You need to Specify the classpath where you would like to put the class. example, in invoking the:
Runtime.getRuntime().exec("javac foo.java");
This is true, the compiling takes place and the "java foo.java" or calling the notepad will surely run. But, you didnt specify where the class file should be located. You can add it by invoking the -classpath function in javac. It may look more like this: (Putting the class in a single folder)
Runtime.getRuntime().exec("javac -classpath \"YourClassFolder\" \"Filepath\\foo.java\"");
Or if you want this: (putting the class in the same Folder)
Runtime.getRuntime().exec("javac -classpath \"FilePath\" \"Filepath\\foo.java\"");
^_^ God Bless in your code. I hope that helps.
Are you creating your own IDE? =)