View Single Post
  #6 (permalink)  
Old 05-12-2008, 09:24 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
Eku is on a distinguished road
when compiling within a program. You need to Specify the classpath where you would like to put the class. example, in invoking the:
Code:
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)
Code:
Runtime.getRuntime().exec("javac -classpath \"YourClassFolder\" \"Filepath\\foo.java\"");
Or if you want this: (putting the class in the same Folder)
Code:
Runtime.getRuntime().exec("javac -classpath \"FilePath\" \"Filepath\\foo.java\"");
^_^ God Bless in your code. I hope that helps.
Are you creating your own IDE? =)

Last edited by Eku : 05-12-2008 at 09:48 AM.
Reply With Quote