Thursday, August 18, 2016

build a jdk rt.jar with debug option

1)download the src.zip for your jdk 2)unzip src.zip into a tmp/src folder:unzip src.zip -d /src 3)get list of all java class into a file: find -name "*.java* > files.txt 4)compile all java files:javac -verbose -g -d ..\out -J-Xmx2048m -cp c:\jdk7u80\jre\lib\rt.jar;c:\jdk7u80\lib\tools.jar @files.txt 5)create jar file:cd tmp\out; jar cvf rt.jar * 6)copy the rt.jar into jdk\jre\lib\endorsed

Wednesday, August 17, 2016

Log4J appender format

here is the best log4J appender ConversionPattern value "%d{MM/dd/yyyy hh:mm:ss aa} [%-5p] [%c{1}] - %m%n", it approved working it print out the date time, log type and class name and message remember put it in the appender you expected, because we might have mutiple appender, one for file, one for console, etc.