sure why not, actually Eclipse & Netbeans (the two famous Java IDEs) are built using Java.if you want an idea on how you can achieve that please see this URL http://stackoverflow.com/questions/4277170/compiling-a-java-program-using-another-java-program