Using NetBeans C/C++ development pack to work with OpenJDK HotSpot project
Links
HotSpot under NB project
http://cnd.netbeans.org/docs/hotspot-projects
OpenJDK - HotSpot
http://openjdk.java.net/groups/hotspot/
Since May, 2007 Sun opens almost all of the JDK under the GPL 6.5
HotSpot part of it handles Java virtual machine sources.
NetBeans IDE
http://www.netbeans.org/products/ide/
NetBeans C/C++ development pack
http://www.netbeans.org/products/cplusplus/
The NetBeans C/C++ Development Pack provides C and C++ development support to
the NetBeans community.
SunStudio
http://developers.sun.com/sunstudio/downloads/
For compilers required to build HotSpot.
Requirements
- You need to have NetBeans IDE with C/C++ NetBeans development pack installed. Follow instructions here if you don't have one.
- Your machine have to fulfil the requirements to compile HotSpot. Usually it's enough to have linux-intel or solaris-intel machine with SunStudio installed and JDK 1.5 or later. You can find more details here.
Content
- NB projects for Solaris-intel/sparc or Linux configuration
- Readme
Preparing sources to use with premade NB projects
- Premade projects were created for HotSpot build b16 from July 20, 2007. But
they should work for later builds as well.
- Download and unpack to the same folder
- Check if your HotSpot sources are writable. If not run next command on hotspot folder:
chmod a+rw hotspot
- Copy hotspot folder from preconfigured folder according to your system.
E.g. for solaris system you can run next command from the folder you've unpacked
files to in step 1:
cp -R solaris-intel/hotspot openjdk
- You need to build HotStop if you want to have fully functional project because
HotSpot has a lot of generated sources. If you just want to browse sources you
can skip this step.
To build HotSpot
- Run NetBeans IDE with set up C/C++ development pack
- From NB open folder openjdk/hotspot/build. Choose one of next projects:
| Project for | Path to projects | Build Command
----------------------------------------------------------------------------
server solaris_i486_compiler2/projects/hotspot build.sh jvmg <dir>
client solaris_i486_compiler1/projects/hotspot build.sh jvmg1 <dir>
core solaris_i486_core/projects/hotspot build.sh jvmgcore <dir>
tiered solaris_i486_tiered/projects/hotspot build.sh jvmgtiered <dir>
Troubleshooting
-
Makefile: Unexpected end of line
Reason: you are using dmake or make by default, but HotSpot require gmake (gnumake) to handle it's Makefiles
Solution:
- before building HotSpot you have to run next command:
export MAKE=gmake
- in NetBeans IDE go to "Tools/Options" -> "C/C++ Setings" and change "make command" field to "gmake"
- Build reports compilers incompatibility
Reason: most likely you are using last Sun compilers version 5.9 and HotSpot wants 5.8 by default
Solution: