Skip to main content
This revision made June 10, 2013 09:49, by Patrick Reinhart

Build on Windows

I use Windows7 64bit in VMware Fusion on a MacBook Air 1.8 GHz Intel Core i7, 4GB, Mac OS X 10.7.5. The image uses 1 processor core and 2048 MB of memory.

Install VisualC++ 2010 Express (including service pack 1)

From http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express, Filename: wdexpress_full.exe

 (only C++ is needed), install it without optional products (ie without Silverlight or MS SQL 2008 Express SP1).

or

go to http://go.microsoft.com/?linkid=9709949 to download VC++.

Make sure to download the correct file. This will be needed to compile Freetype2 later on.

Install Windows SDK for Windows 7 and .Net

From http://www.microsoft.com/en-us/download/details.aspx?id=8279, Filename: winsdk_web.exe

(Silverlight was also installed as part of this installation, but don't install the samples and .Net tools)

Install Microsoft DirectX 9 SDK

From http://www.microsoft.com/en-us/download/details.aspx?id=6812, Filename: DXSDK_Jun10.exe

In case the above link has changed (Microsoft moves their web links around), then try the below link (search for the term "dxsdk"):
http://www.microsoft.com/en-us/download/search.aspx?q=dxsdk

The Microsoft Download Centre search page can be found at
http://www.microsoft.com/en-us/download/

The DirectX SDK installation program can be search from here.

Reboot


Compiler sanity check

Open a cmd shell and type:

 C:\WINDOWS\system32\cmd.exe /E:ON /V:ON /K "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /Release /xp /x64

If you see:

 Setting SDK environment relative to C:\Program Files\Microsoft SDKs\Windows\v7.1\.
 Targeting Windows XP x64 Release

then your compilers are ok.

Install the compilers in case they got lost after installing a service pack of Windows SDK

From http://www.microsoft.com/en-us/download/details.aspx?id=4422, Filename: VC-Compiler-KB2519277.exe

You may want to perform the sanity check again to make sure that all needed compilers are available

Install an actual Java 7 JDK

From http://www.oracle.com/technetwork/java/javase/downloads/index.html, Filename: jdk-7u15-windows-x64.exe in case you using a 64bit Windows installation.

This is needed as a bootstrap JDK to build the OpenJDK.

Install Apache Ant

Apache Ant installation is no longer required with the new OpenJDK build process, instructions have been archived.

Download the Freetype2 project

From http://sourceforge.net/projects/freetype/files/latest/download?source=files, Filename: ft2410.zip

Note: the Freetype2 version downloaded from the above link maybe be different (later) than the one mentioned in this section. Version numbering appearing in the instructions in this section and the ones following below, are highlighted so to bring awareness that it needs to be adjusted in line with the downloaded version number of the Freetype2 binary/archive.

Unzip into

 C:\OpenJDK\freetype-2.4.10

In the C:\OpenJDK\freetype-2.4.10\build\ folder, make a copy of the Win32 folder (if one exists) and call it Win64 for Windows 64 binaries.

Build the Freetype2 project for Windows 64 bit

(Screenshots to be added)

  1. Start Microsoft Visual C++ 2010 Express
  2. Open the following project: C:\OpenJDK\freetype-2.4.10\builds\win64\vc2010\freetype.vcxproj
  3. From the projects properties do the following:
    1. Configuration Manager -> Active solution platform -> Dropdown (choose New and select x64)
    2. Configuration -> Release Multithreaded
    3. Platform -> x64
    4. Output Directory -> rename ".\..\..\..\objs\win32\vc2010\" to ".\..\..\..\lib" (the lib directory should be a direct child of C:\OpenJDK\freetype-2.4.10\builds\win64)
    5. Target Name -> rename to "freetype"
    6. Platform Toolset -> Windows7.1SDK
  4. Choose "Release Multithreaded"/"x64" in the menu bar and build the project by choosing "Build freetype" from the Build menu. This will create the 64-bit freetype.lib in the corresponding output directory /lib.
  5. Change the "Configuration Type" to "dll" in the project properties and build again. Now the 64-bit freetype.dll will be build in the output directory /lib.

Anti virus consideration

Exclude directories

Exclude directories like C:\OpenJDK and C:\cygwin from your anti-virus scanner, by adding them to the white list maintained by your Anti-virus program.

Disable realtime access of your anti-virus scanner for some file types

This might be related to the Access denied problem, and probably varies between different anti-virus products. At the moment I recommend to exclude the following file types from realtime scanning:

  • *.c
  • *.cpp
  • *.h
  • *.hpp
  • *.java

Install the Enhanced Mitigation Experience Toolkit

From http://www.microsoft.com/en-us/download/details.aspx?id=29851, Filename: EMET Setup.msi

In case the above link does not work, please visit the Microsoft Download Centre at http://www.microsoft.com/en-us/download/default.aspx and search for the term "EMET".

Disable ASLR (Address Space Layout Randomization)

This is needed if you experience strange hangs when building your OpenJDK. (That solved it for me under Windows 7)

( Screenshots to be added )

  1. Launch EMET
  2. Press the 'Configure System' button and choose ASLR 'Disabled'
  3. Reboot

Note: the above step seems to stop IntelliJ from starting so please be mindful if you are using IntelliJ, either do not use this step or revert it if you experience the mentioned issue. As of the writing of this step we do not have a direct solution to the problem.

Configure and run the make

Note: ensure that after rebooting the system the windows\systems32 directory is still in the $PATH of Cygwin, to avoid any commands to fail. One of the windows installation program might have take it off from the path.

Start a cygwin shell using the desktop icon (in my case it is configured to do 'C:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico -')

 $ cd /cygdrive/c/OpenJDK/jdk8_tl
 $ bash configure --with-freetype=/cygdrive/c/OpenJDK/freetype-2.4.10/win64 --with-msvcr-dll=/cygdrive/c/Program\ Files/Java/jdk1.7.0_15/bin/msvcr100.dll
 $ make

or

 $ make clean images

See configure and make command arguments for build performance optimisation.

Got feedback or questions?

Feedback and/or corrections are welcome. (@reinhapa or @ohumbel). Alternatively also refer to Ludovic Hochet's blog.

Next Step

Difference compared to previous revision
The image uses 1 processor core and 2048 MB of memory. == Install VisualC++ 2010 Express (including service pack 1) From [http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express], Filename: vc___TOC__ = Build on Windows I use Windows7 64bit in VMware Fusion on a MacBook Air 1.8 GHz Intel Core i7, 4GB, Mac OS X 10.7.5. ... The image uses 1 processor core and 2048 MB of memory. == Install VisualC++ 2010 Express (including service pack 1) From [http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express], Filename: wdwebexpress_full.exe (only C++ is needed), install it without optional products (ie without Silverlight or MS SQL 2008 Express SP1). or ... (Silverlight was also installed as part of this installation, but don't install the samples and .Net tools) == Install Microsoft DirectX 9.0 SDK From [http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=2141.exe (only C++ is needed), install it without optional products (ie without Silverlight or MS SQL 2008 Express SP1). or ... (Silverlight was also installed as part of this installation, but don't install the samples and .Net tools) == Install Microsoft DirectX 9 SDK From [http://www.microsoft.com/en-us/download/details.aspx?id=68126], Filename: dxsdk], Filename: DXSDK_sJum2n1004.exe

In case the above link has changed (Microsoft moves their web links around), then try the below link (search for the term "dxsdk"):
http://www.microsoft.com/en-us/download/search.aspx?q=dxsdk

 
 
Close
loading
Please Confirm
Close