Skip to content

Instantly share code, notes, and snippets.

Created November 30, 2014 19:28
Show Gist options
  • Save cdman/84e195d9f5d36e401c8b to your computer and use it in GitHub Desktop.
Save cdman/84e195d9f5d36e401c8b to your computer and use it in GitHub Desktop.
Ant script to recompile the JDK runtime with full debug symbols
<project name="create rt_debug.jar" default="makejar" basedir=".">
<target name="init">
<property environment="env"/>
<property name="" location="build"/>
<property name="project.src" location="${}/src"/>
<property name="project.classes" location="${}/classes"/>
<property name="project.dist" location="${}/dist"/>
<path id="project.classpath">
<fileset dir="${env.JAVA_HOME}/jre/lib">
<include name="*.jar"/>
<target name="clean" depends="init">
<delete dir="${}" quiet="true"/>
<mkdir dir="${}"/>
<target name="unpack" depends="init, clean">
<unzip src="${env.JAVA_HOME}/" dest="${project.src}"/>
<target name="build" depends="unpack">
<mkdir dir="${project.classes}"/>
<javac srcdir="${project.src}" classpathref="project.classpath"
destdir="${project.classes}" debug="on" includeAntRuntime="false"
fork="true" memoryMaximumSize="4096m" failonerror="false">
<target name="makejar" depends="build">
<mkdir dir="${project.dist}"/>
<copy file="${env.JAVA_HOME}/jre/lib/rt.jar" tofile="${project.dist}/rt_debug.jar"/>
<jar jarfile="${project.dist}/rt_debug.jar" update="true" compress="true">
<fileset dir="${project.classes}"/>
Debug library built. You can find it at ${project.dist}/rt_debug.jar. Use any of the following methods to make use of it:
- copy it to ${env.JAVA_HOME}/jre/lib/endorsed/ (create the directory if it doesn't exists)
- use the -Xbootclasspath property to specify this jar
- overwrite ${env.JAVA_HOME}/jre/lib/rt.jar with it (backing up the original is highly recommended!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment