NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed. (sponsored)
In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.
Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.
Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.
Java has powerful debugging facilities. Most of you that use debugging have seen that when stepping over a JRE class, no variables, members and values are available. This is because JRE distributions are (even beta's) compiled without including debug info. This is because of preserving memory and improving performance of default Java program execution.
Sometimes, it is beneficiary to step into a library class in order to better understand it's inner workings for spotting a bug in either your code or the library's. Most frequently I have to step inside a Swing class to understand the workflow and interactions in Swing classes and my code.
As you know, JDK comes with the sources of library classes. By recompiling these sources with debug info, it is possible to produce a JDK that allows for stepping into JRE classes with debug info. Here's how to recompile for JDK 1.6.0 on Windows. Note that it is perfecly applicable for other versions. Just make appropriate changes in directories and version numbers.
* Before starting, install GNU utilities for Win32. GNU utilities for Win32 includes Windows executables that match to many unix tools such as ls, find, cat, less. After installing, add ...\usr\local\wbin\ to system path
* Create a temporary directory. Let's say "tmp"
> mkdir \tmp
> mkdir \tmp\out
* Extract src.zip in JDK installation directory to tmp\src
* Use find utillity to get a list of all java files in tmp\src
Is this required to do when using an IDE like Eclipse?.
In Eclipse you just point the location of src.zip and you can easily step through the JDK code during debugging
i am not an eclipse user but as fas as i know from other ide's, the jre classes in rt.jar comes without debugging info which is needed for stepping inside and tracking variables.
by default, jre is compiled without this essential debugging info for keeping rt.jar size small.
While it is true that you can step into the RT files, you often cannot see variable/parameters and values. So recompiling them might still give you additional info.
Generally speaking, it's not required to merge 2 jars together. You can achieve same effect by preparing jre-patch.jar and then use special jvm parameter:
-Xbootclasspath/p:jre-patch.jar
It will guarantee that your patch will be loaded before original rt.jar (you patch it).
Enabling debugging inside JRE classes
At 7:22 PM on Nov 15, 2007, Ahmet ISIK wrote:
Fresh Jobs for Developers Post a job opportunity
Sometimes, it is beneficiary to step into a library class in order to better understand it's inner workings for spotting a bug in either your code or the library's. Most frequently I have to step inside a Swing class to understand the workflow and interactions in Swing classes and my code.
As you know, JDK comes with the sources of library classes. By recompiling these sources with debug info, it is possible to produce a JDK that allows for stepping into JRE classes with debug info. Here's how to recompile for JDK 1.6.0 on Windows. Note that it is perfecly applicable for other versions. Just make appropriate changes in directories and version numbers.
* Before starting, install GNU utilities for Win32. GNU utilities for Win32 includes Windows executables that match to many unix tools such as ls, find, cat, less. After installing, add ...\usr\local\wbin\ to system path
* Create a temporary directory. Let's say "tmp"
> mkdir \tmp
> mkdir \tmp\out
* Extract src.zip in JDK installation directory to tmp\src
* Use find utillity to get a list of all java files in tmp\src
> cd src
> \unxutils\usr\local\wbin\find.exe -name *.java > files.txt
* Please note that I didn't use find.exe from system path. This is because there is an internal command exactly named "find" in Windows shell.
With the last command, we have obtained a file that includes the names of all java files.
* Compile sources
"c:\Program Files\Java\jdk1.6.0\bin\javac" -verbose -g -d \tmp\out -J-Xmx512m -cp "c:\Program Files\Java\jdk1.6.0\jre\lib\rt.jar";"c:\Program Files\Java\jdk1.6.0\lib\tools.jar" @files.txt
P.S. Don't forget to change jdk path according to your installation
* Extract the original rt.jar in jdk home to tmp\rt
* Copy all the files in \tmp\out to \tmp\rt
* Create a rt.jar from \tmp\rt directory
> cd \tmp\rt
> jar cvf rt.jar *
* Create a copy of your jdk directory and copy generated rt.jar to JDK_HOME\jre\lib\rt.jar
Now you can use your favorite ide for stepping inside JRE classes with debugging info.
Hope it will be useful for someone. I have long needed this but has yet found time to try.
5 replies so far (
Post your own)
Re: Enabling debugging inside JRE classes
Is this required to do when using an IDE like Eclipse?.In Eclipse you just point the location of src.zip and you can easily step through the JDK code during debugging
Re: Enabling debugging inside JRE classes
i am not an eclipse user but as fas as i know from other ide's, the jre classes in rt.jar comes without debugging info which is needed for stepping inside and tracking variables.by default, jre is compiled without this essential debugging info for keeping rt.jar size small.
Re: Enabling debugging inside JRE classes
While it is true that you can step into the RT files, you often cannot see variable/parameters and values. So recompiling them might still give you additional info.Re: Enabling debugging inside JRE classes
Or you can just download and install the official JDK 6.0 distribution with debug info from http://download.java.net/jdk6/binaries/Re: Enabling debugging inside JRE classes
Generally speaking, it's not required to merge 2 jars together. You can achieve same effect by preparing jre-patch.jar and then use special jvm parameter:-Xbootclasspath/p:jre-patch.jar
It will guarantee that your patch will be loaded before original rt.jar (you patch it).
Alexander.