Poonam Bajaj's Blog

Building OpenJDK on Windows with NetBeans

Poonam Parhar
Consulting Member of Technical Staff
Trying to build OpenJDK on Windows ? Here are some simple steps that may help...
Here are the softwares required for the build.
- Download OpenJDK from http://download.java.net/openjdk/jdk7/ and unzip the contents
- Download and install jdk 6.0 from http://java.sun.com/javase/downloads/index.jsp and jdk 7.0 from http://download.java.net/jdk7/binaries
- Download and install openjdk binary plugs from http://download.java.net/openjdk/jdk7/
- Install Microsoft Visual Studio .NET 2003 Professional
- Install Cygwin from http://www.cygwin.com. Make sure you install it in dos/text mode. Along with the default installation, we need to install Devel, Interpreters and Utils pakages. For the build, we need make 3.80, so if the cygwin make in not 3.80, download make bundle from http://cygwin.paracoda.com/release/make/make-3.80-1.tar.bz2 and untar it in a separate folder.
- Download and install findbugs from http://findbugs.sourceforge.net/downloads.html.
- Download and install Ant from http://ant.apache.org/bindownload.cgi
- Install Microsoft DirectX 9.0 SDK
- Download and install Microsoft Unicode library
- Install Freetype 2.3.4 from http://sourceforge.net/project/showfiles.php?group_id=3157
- Install NetBeans 6.0 from http://www.netbeans.org/downloads/

To build OpenJDK with NetBeans, open 'jdk' project in openjdk/jdk/make/netbeans/ with NetBeans. But first open a command window (cmd.exe) and set the path for following installed softwares:
set PATH=d:/utilities/usr/bin;d:\\devtools\\cygwin\\bin;D:\\devtools\\findbugs-1.3.0\\bin;
Here, d:/utilities/usr/bin contains make 3.80. Also, it is setting the path for cygwin, FindBugs and ant.
then run vsvars32.bat of Microsoft Visual Studio .NET:
Now launch Netbeans from this command window.
In Netbeans, click on File->Open Project. Browse to openjdk/jdk/make/netbeans/ and select 'jdk'.
In openjdk/jdk/make/netbeans/common/make.xml file, change the location of bin/make to your 3.80 make.
<target name="-pre-init.windows" if="os.windows">
<property name="platform" value="windows"/>
<property name="make" value="d:/utilities/usr/bin/make"/>
In build.properties file, set the following environment variables:
ALT_BOOTDIR=D:/Java/jdk1.6.0_03 \\
ALT_BINARY_PLUGS_PATH=D:/devtools/openjdk-binary-plugs \\
ALT_JDK_IMPORT_PATH=d:/devtools/jdk1.7.0 \\
ALT_DXSDK_PATH=d:/devtools/dxsdk9 \\
ALT_COMPILER_PATH=D:/Progra~1/Micros~1.NET/Vc7/bin \\
ALT_MSDEVTOOLS_PATH= D:/Progra~1/Micros~1.NET/Common7/Tools/Bin \\
ALT_MSVCR71_DLL_PATH= D:/Progra~1/Micros~1.NET/SDK/v1.1/Bin \\
ALT_FREETYPE_LIB_PATH=d:/devtools/freetype-2.3.4/lib \\
ALT_FREETYPE_HEADERS_PATH=d:/devtools/freetype-2.3.4/include \\
ALT_UNICOWS_LIB_PATH=d:/devtools/unicows \\
ALT_UNICOWS_DLL_PATH=d:/devtools/unicows \\
SHLVL=1 \\
And that's all we need to do. Start the build (press F11 or right click on jdk project and click Build)

Join the discussion

Comments ( 5 )
  • Amit Saturday, December 1, 2007


    I fail to understand, why is DirectX 9.0 SDK required? (just inquisitive). I have succesfully built Open JDK on Linux with/without NetBeans.



  • Poonam Sunday, December 9, 2007

    Java 2D on Windows uses DirectX. And for building it on Windows you need DirectX header files.

  • prathap Saturday, January 29, 2011

    dude why u need need visual studio 2003

  • guest Wednesday, September 12, 2012

    Great now you have to program programming language to simply compile to human readable format, bravo Oracle, might us well give us Windows users Java Lite Edition.

  • guest Wednesday, September 12, 2012

    Great now you have to program programming language to simply compile to human readable format, bravo Oracle, might us well give us Windows users Java Lite Edition.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha