Building 64-bit OpenJDK 6 on Windows 7 x64 SP1

The amd64 build on Windows 7 is similar to the i586 build, but has additional complications.

Cygwin (at least the more common i586 version) works much worse on amd64 Windows. Due to a much bigger address space size, Cygwin fork techniques work much slower and are less reliable.

Visual Studio.NET 2003 does not support the amd64 architecture so the Windows Server 2003 SP1 Platform SDK is used instead.

Getting ready

For this recipe, we should have Windows 7 SP1 i586 running with no antivirus software installed. Antivirus software is not allowed because it may interfere with the Cygwin runtime.

How to do it...

The following steps will help us to build OpenJDK:

  1. Download the Windows Server 2003 SP1 Platform SDK from the Microsoft website and install it using the default installation path. AMD-64 and MDAC (Microsoft Data Access Services) components are required for the build.
  2. Perform steps 2 to 11 from the Building 32-bit OpenJDK 6 on Windows 7 SP1 recipe (for FreeType libraries use 6_64 directory).
  3. Step 12 from the previous recipe is not required for the amd64 build and may be skipped.
  4. Create a build.bat batch file and write the following environment variables settings:
    @echo off
    set LD_LIBRARY_PATH=
    set CLASSPATH=
    set JAVA_HOME=
    set PATH=C:/path_prepend;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;C:/make;C:/cygwin/bin;C:/jdk6/bin;C:/ant/bin
    set ALT_BOOTDIR=c:/jdk6
    set ALT_FREETYPE_LIB_PATH=c:/freetype
    set ALT_FREETYPE_HEADERS_PATH=c:/freetype/include
    set ALT_UNICOWS_LIB_PATH=c:/unicows
    set ALT_UNICOWS_DLL_PATH=c:/unicows
    call "C:/Program Files/Microsoft Platform SDK"/SetEnv.cmd /X64 /RETAIL
    bash
    echo Press any key to close window ...
    pause > nul
  5. Follow steps 14 to 17 from the previous recipe.

How it works...

Most of the notes from the i586 build are also valid for the amd64 build except those specific to VS2003.

Patch to serviceability Makefile is not required because that part of Makefile is specific to i586 builds.

There's more...

To build the most compatible binaries, the same recipe should be used, but the Windows 2003 Server amd64 operating system should be used instead of Windows 7.

In Windows 2003, the chmod 777 command is not required.

See also

  • The Installing Cygwin for Windows builds recipe
  • The Building OpenJDK 6 on Ubuntu Linux 12.04 LTS recipe, for information about build tuning
  • The Building 64-bit FreeType libraries for OpenJDK 6 on Windows recipe
  • The Preparing CA certificates recipe
  • The official build instructions for OpenJDK 6 at http://hg.openjdk.java.net/jdk6/jdk6/raw-file/tip/README-builds.html