profiling Java applications



I'd like to profile Java applications:

See how much time is spent in each class, how much time is in each method.
Stuff like that.

I would *much* prefer something I could use in a command line interface which
spits out text. I would be using the profiler in WinXP/Cygwin and Linux.

Any recommendations that people have experience with?

Thanks,
Pete
.