I have java aplication that in some point it uses javac to compile some java files Then I use reflection and .class dont exist is there a way to make the process wait until files are created in my hard disk
Sorry about my pure English
Printable View
I have java aplication that in some point it uses javac to compile some java files Then I use reflection and .class dont exist is there a way to make the process wait until files are created in my hard disk
Sorry about my pure English
Can you post the code that shows how you are calling javac?
here is the code
public static void compileFiles(String path)
{
System.out.println("Class Creation Started");
try
{
Process rt =Runtime.getRuntime().exec("cmd /c start /min javac "+ path +"\\*.java");
rt.waitFor();
System.out.println("exitvalue:" +rt.exitValue());
}
catch (Exception e) {System.out.println("Unexpected exception Trying to Execute Job: " +e);}
System.out.println("Class Creation Ended");
}
Have you tried executing javac directly instead of using cmd?
Also there is a class that will do a compile via method calls.
See the API doc for the JavaCompiler interface.