Getting and installing the required tools for building the EDK II

Table of Contents


The following are required to be able to build the EDK:








Ant Contrib


Java JDK



8.1.1 for Java



The following tools are optional:






Intel C++ Compiler for Windows


Intel C Compiler for EFI Byte Code


Microsoft Driver Development Kit


Microsoft ACPI Source Language Assembler


Intel ACPI Component Architecture


Install and Configure Tools on Windows XP

Software Installation Order

After installing the compiler tools and your Subversion client, the following required tools should be installed in this order:
Java JDK, Apache-Ant, ant-contrib, xmlbeans, saxon8

Java Development Kit

The Java Environment Variable must be set before attempting to build.
e.g. For Sun JDK:

set JAVA_HOME=c:\Java\jdk1.5.0_06

During installation, you should specify the install directory as C:\Java instead of C:\Program Files (or some other drive letter.)  While installing to this non-standard location is not required. In use, it seems to work more reliably.

NOTE: You cannot combine the location for the JDK and the JRE, as the JRE install removes most of the binaries and libraries installed by the JDK install.

Java Tools

The Apache-ANT requires the ANT_HOME environment variable to be set before attempting to build:

Unzip to a directory. We need to set an environment variable ANT_HOME to this location:

set ANT_HOME=<full path to where ant was unzipped>

Unzip the file. The ant-contrib.jar file should be copied into the %ANT_HOME%\lib directory.

Unzip to a directory. XMLBeans requires the XMLBEANS_HOME environment variable to be set before attempting to build:

set XMLBEANS_HOME=<full path to where xmlbeans was unzipped>

Unzip the file. The saxon8.jar file should be copied to the %XMLBEANS_HOME%\lib directory. Do not download a later version of saxon 8. You will get the following error message if you do:

build.xml:45: java.lang.RuntimeException: Trying XBeans path engine... Trying XQRL... Trying Saxon... FAILED on declare namespace sans=''; $this/sans:FrameworkPlatformDescription/sans:Flash/sans:FvImages/sans:FvImage[@Type='ValidImageNames']/sans:FvImageNames

The Ant and XMLBean tools are required to be in the path.



If you optionally install cygwin (for gcc support) you should install it in "Unix" mode. The gcc tool chain will not compile in "DOS" mode.

Environment Variables

Environment variables are case sensitive. You must use the exact case as in the examples of this document. Even though windows does not care about case, Java does.

You need to set WORKSPACE to the location of the edk2 directory that you pulled from Subversion. For example

set WORKSPACE=c:\workspace\edk2\

It is recommended that you wrap up all the environment variables above into a script that you can launch each time you begin to do development in your EDK II workspace.

The first build

You will need to edit the text file, msft_tools_def.txt, located in the Tools/Conf directory. This file contains the names of the compiler tool chains and the location of the compiler binaries. It has been pre-populated with the standard location for the Microsoft tool chains and includes the standard location of the Intel C Compiler for EFI Byte Code (EBC).

Once the external tools are installed, the environment variables are set, and you have the ant executable in your path, you can try a build.

  1. cd to %WORKSPACE%

  2. run edksetup.bat (this will build several tools that are used in edk2 development. It will fail if the external tools above are not properly installed.)

  3. cd EdkNt32Pkg

  4. type build