Windows Unix Toolkit
Building on Windows requires a Unix-like environment, notably a Unix-like shell. There are several such environments available of which Cygwin and MinGW/MSYS are currently supported for the OpenJDK build. One of the differences of these systems from standard Windows tools is the way they handle Windows path names, particularly path names which contain spaces, backslashes as path separators and possibly drive letters. Depending on the use case and the specifics of each environment these path problems can be solved by a combination of quoting whole paths, translating backslashes to forward slashes, escaping backslashes with additional backslashes and translating the path names to their "8.3" version.CYGWIN
CYGWIN is an open source, Linux-like environment which tries to emulate a complete POSIX layer on Windows. It tries to be smart about path names and can usually handle all kinds of paths if they are correctly quoted or escaped although internally it maps drive letters<drive>:
to a virtual directory/cygdrive/<drive>
.You can always use the
cygpath
utility to map pathnames with spaces or the backslash character into theC:/
style of pathname (called 'mixed'), e.g.cygpath -s -m "path"
.Note that the use of CYGWIN creates a unique problem with regards to setting
PATH
. Normally on Windows thePATH
variable contains directories separated with the ";" character (Solaris and Linux use ":"). With CYGWIN, it uses ":", but that means that paths like "C:/path" cannot be placed in the CYGWIN version ofPATH
and instead CYGWIN uses something like/cygdrive/c/path
which CYGWIN understands, but only CYGWIN understands.The OpenJDK build requires CYGWIN version 1.7.16 or newer. Information about CYGWIN can be obtained from the CYGWIN website at www.cygwin.com.
By default CYGWIN doesn't install all the tools required for building the OpenJDK. Along with the default installation, you need to install the following tools.
Note that the CYGWIN software can conflict with other non-CYGWIN software on your Windows system. CYGWIN provides a FAQ for known issues and problems, of particular interest is the section on BLODA (applications that interfere with CYGWIN).
Binary Name Category Package Description ar.exe Devel binutils The GNU assembler, linker and binary utilities make.exe Devel make The GNU version of the 'make' utility built for CYGWIN m4.exe Interpreters m4 GNU implementation of the traditional Unix macro processor cpio.exe Utils cpio A program to manage archives of files gawk.exe Utils awk Pattern-directed scanning and processing language file.exe Utils file Determines file type using 'magic' numbers zip.exe Archive zip Package and compress (archive) files unzip.exe Archive unzip Extract compressed files in a ZIP archive free.exe System procps Display amount of free and used memory in the system MinGW/MSYS
MinGW ("Minimalist GNU for Windows") is a collection of free Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs. MSYS is a supplement to MinGW which allows building applications and programs which rely on traditional UNIX tools to be present. Among others this includes tools likebash
andmake
. See MinGW/MSYS for more information.Like Cygwin, MinGW/MSYS can handle different types of path formats. They are internally converted to paths with forward slashes and drive letters
<drive>:
replaced by a virtual directory/<drive>
. Additionally, MSYS automatically detects binaries compiled for the MSYS environment and feeds them with the internal, Unix-style path names. If native Windows applications are called from within MSYS programs their path arguments are automatically converted back to Windows style path names with drive letters and backslashes as path separators. This may cause problems for Windows applications which use forward slashes as parameter separator (e.g.cl /nologo /I
) because MSYS may wrongly replace such parameters by drive letters.In addition to the tools which will be installed by default, you have to manually install the
msys-zip
andmsys-unzip
packages. This can be easily done with the MinGW command line installer:mingw-get.exe install msys-zip
mingw-get.exe install msys-unzip