Solved

Reading output from JDK with VB.

Posted on 1998-09-16
3
148 Views
Last Modified: 2010-04-30

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.




0
Comment
Question by:vienna
  • 2
3 Comments
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1435334
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.
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1435335
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

0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 450 total points
ID: 1435336
 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
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now