wood burning stoves*
The moose likes Java in General and the fly likes Controlling Java Compiler by Program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Controlling Java Compiler by Program" Watch "Controlling Java Compiler by Program" New topic
Author

Controlling Java Compiler by Program

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
I want to dynamically generate java source files and compile them into .class files for users to download. Is there any way to programmatically control the jdk compiler? I know Tomcat is able to compile JSP into class files dynamically. How does it do this?
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

There is an existing service that does this -> http://www.innovation.ch/java/java_compile.html

You may invoke the javac command through the ProcessBuilder or use the JavaCompiler API to do this. Is this for a class project or something ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Controlling Java Compiler by Program