• Post Reply Bookmark Topic Watch Topic
  • New Topic

output redirect??  RSS feed

 
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...
 
author and iconoclast
Sheriff
Posts: 24219
40
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.
 
Ravi Ramnath
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 .
 
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
Sheriff
Posts: 24219
40
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
 
Ravi Ramnath
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
 
it's a teeny, tiny, wafer thin ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!