i am trying to build an online java compiler , written in jsp , where server end accepts uploaded code from clients , compile them and then run the codes and finally prints the output to the user to html forms. i wrote a code that creates a temporary java file (temp.java) contains the code from client , then compile it , creating the (temp.class) file , the problem is in the final step when i try to execute the file , it runs fine when i use the local machine cmd :
java temp
but when i call the command on the server using the java runTime like this :
Process proc = Runtime.getRuntime().exec("java testing/temp");
the output is :
Error: Could not find or load main class temp
the problem is , the runtime cant find the binary file.. what is the path then ? the compiler is in a package that contains the java files , while the clients binary files are createdand stored in a folder (testing) in build/web ..