Link to home
Start Free TrialLog in
Avatar of vienna
vienna

asked on

Reading output from JDK with VB.


Please read this q. carefully.

I am NOT looking how to shell the JDK compiler (javac),
but to do a more complicated task, reading the
information the JDK displays after an attempt to
compile. (Errors and where or not)

I have tried shelling like this
javac >hello.txt name.java & 
javac name.java > hello.txt
and none of these methods seem to work.
Even shelling a *.bat file with the same instructions
doesn't work.

Use the DOS Console and try them out,
the hello.txt file remains empty.

So, for 450 Points,
I would like to know how to read this output.
I do not care how you do it, but as long as it somehow
writes the output to a file on the Hard Drive or
a string, or TextBox. Somewhere.




Avatar of a111a111a111
a111a111a111

You can capture the DOS screen.

Do so by Alt-Enter and then Click Mark (Copy) then Highlight.
now you can paste it to any text editor.

I think it will give you some direction.
You can reject the stupid answer of A111a111a111.

Here is the real solution. I can't answer it now since the question is locked by a111a111a111

 javac writes errors to stderr, so on NT use:
    javac myfile.java 2> errors.dat

 On Win95, this doesn't work (as command.com is very poor software), so you  have to use the javac error redirection mechanism:
   javac -J-Djavac.pipe.output=true myfile.java > errors.txt

ASKER CERTIFIED SOLUTION
Avatar of Mirkwood
Mirkwood

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial