Thursday, May 1, 2008

Java -verbose option

I haven't used any specific command-line parameters running java.exe earlier. But yesterday I ran across the problem that concluded in that JBoss loaded the old version of my class file although I had upgraded all *.war and *.ear files to the last version. I was stuck wondering what the quirk it was.

Finally, I decided to find out where that wacky class has been loaded from. Java -verbose option fitted my task perfectly. It forces to display all class loading results in the console. If you get too many results, you can forward all output to some file using OS specific contstructions like this "> out.txt"

To read more about "Class Loading in Java" you can, for example, here

No comments: