Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how see jdk logs  RSS feed

 
nafise hasani
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
how Can I see the logs that jdk produce during compilation of java files ?
how can I copy the in a file?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using some odd compiler? None of the compilers I have log anything to a file, only to standard output.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use standard output redirection to pipe the output into a file and there's your logfile.

How standard output redirection works depends on your operating system but usually it involves the > character possibly preceded by a stream identifier.


P.S. you can use the -verbose flag to the compiler to make sure there's always output.
As you will know the compiler will normally only give output in case of failure.
[ November 10, 2004: Message edited by: Jeroen Wenting ]
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is probably the standard question of how to redirect stderr on Windows 95/98/ME; the command window doesn't have scrollback, and the error messages scroll off the screen, but command.com/exe don't let you redirect stderr.

Since JDK 1.2, the answer is to use the -Xstdout switch:

javac -Xstdout logfile BuggyProgram.java

All the output from the compiler will go into "logfile" instead of to the screen.

I'm moving this to Java in General (Beginner) for any further discussion.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!