• Post Reply Bookmark Topic Watch Topic
  • New Topic

Customized interface for javac and java?  RSS feed

 
Matthew Alesi
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was considering making a program that includes using the javac tool, as well as the java command line tool, in the GUI as a critical part. As an example I would site an IDE like NetBeans, which can compile your files as well as run a "mini" command line in the bottom of the window when you run your program.

How would I go about using javac to compile files in my program, and how would I go about displaying the command line output of the java tool in a textarea in my program? Any leads, however small, would be much appreciated!!!

Thanks!
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java 6 has a new API for using the Java compiler from within a Java program. See the documentation of package javax.tools.

If you're using an older version of Java, then you could call the Java compiler as an external process using Runtime.exec() or class ProcessBuilder, and then catching the output of the stdout / stderr streams.
 
Karthick Dharmarajan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please see the below link.

http://www.javaworld.com/javaworld/javatips/jw-javatip131.html

Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!