This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

question about compiling  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there any way to transfer the result of the compiling to a text file? i compiled in a ms-dos environment and i have used ">"(javac hello.java > hello.txt) command to try transfer it in a text file but the text file does not have anything in it even if the compiled code has errors
 
author
Sheriff
Posts: 23510
138
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remember that a program has both a standard out and standard err. To redirect *all* of the output, you need to send both the standard out and err to the file.

For Windows XP, this command will do just that...

javac hello.java > hello.txt 2>&1

Henry
 
rainier valde
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you!!!
 
Sheriff
Posts: 21330
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Henry Wong:
[QB]For Windows XP, this command will do just that...

javac hello.java > hello.txt 2>&1


That will work on most modern operating systems - I know for sure that Linux and Unix (and therefore also MacOS) support it. It's more likely Windows copied it from Unix than vice versa.
 
CAUTION! Do not touch the blades on your neck propeller while they are active. Tiny 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!