Here you can find the source of printStackTrace()
public static void printStackTrace()
//package com.java2s; //License from project: Apache License public class Main { public static void printStackTrace() { for (StackTraceElement ste : Thread.currentThread().getStackTrace()) { System.out.print(ste); }/* w w w. java2 s.co m*/ } }