No special compilation is needed, and you do not even need access to the source code to get the profiling data for a Java program. All you need to do is use a profiling option when invoking the Java Virtual Machine. To find out which profiling options are supported for your version of the JVM, see the appropriate section below.