• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

output redirect??

 
Ravindra Harige
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ravindra Harige
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ernest,
I work on windows XP Pro with SP2 .
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic