| Author |
output redirect??
|
Ravindra Harige
Ranch Hand
Joined: Jun 10, 2005
Posts: 33
|
|
cant we redirect the output of javac to a file? i've tried 'redirect operator' ( > ) but it didnt worked. is there any alternate...
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
|
|
|
The error output goes to the standard error stream; redirecting with ">" generally effects only the standard output. The precise syntax for redirecting the error stream (or even if it's possible at all) depends on your OS or shell.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Ravindra Harige
Ranch Hand
Joined: Jun 10, 2005
Posts: 33
|
|
hi ernest, I work on windows XP Pro with SP2 .
|
 |
Edwin Dalorzo
Ranch Hand
Joined: Dec 31, 2004
Posts: 961
|
|
Use the static method setErr(PrintStream err) from the System class. You can do the same with the default output with setOut(PrintStream out). Regards, Edwin Dalorzo
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
|
|
Originally posted by Edwin Dalorzo: Use the static method setErr( PrintStream err) from the System class.
Yes, for your own applications -- but not terribly useful when running javac.exe , which is what we're talking about here. Anyway, in XP you can use "2>", as in javac Foo.java > output 2> errors
|
 |
Ravindra Harige
Ranch Hand
Joined: Jun 10, 2005
Posts: 33
|
|
Hi Ernest, Thank you. The solution that you provided was exactly what I was looking for and it works just the way I wanted. regards, ravindra harige
|
 |
 |
|
|
subject: output redirect??
|
|
|