If you plan to make changes to HotSpot or any other C++ part of OpenJDK, then it is certain that you will need to do some step-by-step debugging of the code. This recipe will explain how to set up NetBeans IDE for that purpose.
To get started, there are only a few things required—downloaded Open JDK sources and installed NetBeans IDE. It is assumed that the OpenJDK project is already set up and can build sources.
The first step is to set up an executable that will run. Go to Run | Set project configuration / Customize and then Build | Make, and set build/linux-amd64-debug/hotspot/outputdir/linux_amd64_compiler2/jvmg/gamma as the build result, as shown in the following screenshot:
Then select the Run option on the tree on the left had side and set Run Command as "${OUTPUT_PATH}" –version:
The
–version
flag here is just the simplest thing you can run—get the Java version. You can later change it to whatever you want, for example, to...