Search

Categories

Links

Referers

How to strip debug information

Jan 24 2006, 05:39:56 PM PST »Java
Earlier today a former colleague called and asked me how to strip debug information from classes compiled with javac's option -g. It turns out that it is very easy with Sun's JDK. In the same directory as the javac executable is another program, pack200. If you have a jar file with debugging information and want to remove, simply run pack200 like this:
pack200 -r -G debug.jar

This will strip all debug information from the jar file. Now this is a round-about way of doing it and probably not the fastest way. However, it works in a plain Sun JDK.

Post a Comment:
Comments are closed for this entry.
Comments:

Java is a trademark of Sun Microsystems, Inc.
Copyright © 2006,2007 Peter von der Ahé