I'm writing an IDE for java and already got the compiler linked into it, but I can't figure out how to read the data on the System.err or System.out streams.

Recommended Answers

All 3 Replies

Hi everyone,

When you run javac.exe, you will need the Process class. In that class see the error stream, input stream

Richard West

To use javac, I'm using the compile method from Main in this package. It's in the tools.jar of the lib directory. I can't find any API docs for the package though.

com.sun.tools.javac.Main javac = new com.sun.tools.javac.Main();

I can't find any API docs for the package though.
com.sun.tools.javac.Main javac = new com.sun.tools.javac.Main();

You can't find the documentation for it because it is in the com.sun package.
Try not to use this package as there is not gurantee that it will be in the next release.

Try running the external javac.exe by using the runtime class. It works better and is easier

Yours Sincerely

Richard West

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.