I'm creating an application to generate Java applications from templates. I'd like to call the java compiler and later the jar to create the jar package. What's the best way to do that?
Quick example: My application will generate the file myApp.java based on the myTemplate.java file. My application will replace a lot of place holders in the template with generated java code. I'd like to run, from my application the following commands:
javac *.java
jar -cvf myApp.jar *.class (I know the command is not right).
I'd like to be able to find out if the compilation failed and/or the jar creation failed.
This is something like what eclipse does, but much simpler, of couse.
Thanks very much for your help.