这几天研究JMX的Agent,有些文件无法Debug,打不了断点,还有些源文件由于版权原因也不能开放,之前是用jd-gui.exe反编译工具来看源码的,虽然没有在eclipse里看方便,但总比没有的强。昨天无意看到大神的博客,原来是因为编译CLASS的时候参数设置的原因,具体参见http://hllvm.group.iteye.com/group/topic/25798。
本想自己编译JDK的,发现好麻烦,还是先弄份源代码吧,这是Ant Script。
<project name="buildJDK7" default="zipSource" basedir=".">
<property name="openJDKSrcPath" value="D:\OpenJDK7\openjdk-7u40-fcs-src-b43-26_aug_2013" />
<property name="openJDKDestPath" value="D:\OpenJDK7\src" />
<target name="zipSource" depends="">
<copy todir="${openJDKDestPath}" overwrite="false">
<fileset dir="${openJDKSrcPath}\jdk\src\share\classes">
</fileset>
<fileset dir="${openJDKSrcPath}\jdk\src\windows\classes">
</fileset>
</copy>
<zip destfile="src.zip" basedir="${openJDKDestPath}" includes="**/*.java"/>
<move file="src.zip" todir="${openJDKDestPath}\.." overwrite="false"/>
</target>
</project>