Debugging Java code using NetBeans
Obviously, when someone is writing any code, some debugging is required. It is no surprise that NetBeans, as a high-standard IDE, provides some tools to do that. This recipe will show how to debug the Java code using NetBeans.
Getting ready
You will need to install NetBeans and set up a development environment, as described previously in the chapter.
How to do it...
We will use NetBeans to debug our own OpenJDK Java code. We will need to rebuild OpenJDK with debug symbols, and configure NetBeans to make debugging possible:
- First, let's make our OpenJDK instance with debug symbols:
bash ./configure --enable-debug make all CONF=linux-x86_64-normal-server-fastdebug
- Let's ensure that a debuggable version is built:
./build/linux-x86_64-normal-server-fastdebug/jdk/bin/java ...
Get OpenJDK Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.