Just out of curiosity. Can we compile & run a java file from another java program? If so, can you send a reference to that knowledge source?
Take a look at Java Compiler Api and this little example.