--- old/doc/building.html 2020-05-20 17:58:15.732071763 -0700 +++ new/doc/building.html 2020-05-20 17:58:15.348064390 -0700 @@ -30,13 +30,11 @@
The JDK is a massive project, and require machines ranging from decent to powerful to be able to build in a reasonable amount of time, or to be able to complete a build at all.
We strongly recommend usage of an SSD disk for the build, since disk speed is one of the limiting factors for build performance.
At a minimum, a machine with 2-4 cores is advisable, as well as 2-4 GB of RAM. (The more cores to use, the more memory you need.) At least 6 GB of free disk space is required (8 GB minimum for building on Solaris).
+At a minimum, a machine with 2-4 cores is advisable, as well as 2-4 GB of RAM. (The more cores to use, the more memory you need.) At least 6 GB of free disk space is required.
Even for 32-bit builds, it is recommended to use a 64-bit build machine, and instead create a 32-bit target using --with-target-bits=32
.
At a minimum, a machine with 4 cores is advisable, as well as 4 GB of RAM. (The more cores to use, the more memory you need.) At least 8 GB of free disk space is required.
-Note: The sparc port is deprecated.
At a minimum, a machine with 8 cores is advisable, as well as 8 GB of RAM. (The more cores to use, the more memory you need.) At least 6 GB of free disk space is required.
If you do not have access to sufficiently powerful hardware, it is also possible to use cross-compiling.
This is not recommended. Instead, see the section on Cross-compiling.
The mainline JDK project supports Linux, Solaris, macOS, AIX and Windows. Support for other operating system, e.g. BSD, exists in separate "port" projects.
+The mainline JDK project supports Linux, macOS, AIX and Windows. Support for other operating system, e.g. BSD, exists in separate "port" projects.
In general, the JDK can be built on a wide range of versions of these operating systems, but the further you deviate from what is tested on a daily basis, the more likely you are to run into problems.
This table lists the OS versions used by Oracle when building the JDK. Such information is always subject to change, but this table is up to date at the time of writing.
Oracle Enterprise Linux 6.4 / 7.6 | |
Solaris | -Solaris 11.3 SRU 20 | -
macOS | Mac OS X 10.13 (High Sierra) |
Windows | Windows Server 2012 R2 |
The double version numbers for Linux and Solaris are due to the hybrid model used at Oracle, where header files and external libraries from an older version are used when building on a more modern version of the OS.
+The double version numbers for Linux are due to the hybrid model used at Oracle, where header files and external libraries from an older version are used when building on a more modern version of the OS.
The Build Group has a wiki page with Supported Build Platforms. From time to time, this is updated by contributors to list successes or failures of building on different platforms.
Windows XP is not a supported platform, but all newer Windows should be able to build the JDK.
@@ -223,10 +213,6 @@It's possible to build both Windows and Linux binaries from WSL. To build Windows binaries, you must use a Windows boot JDK (located in a Windows-accessible directory). To build Linux binaries, you must use a Linux boot JDK. The default behavior is to build for Windows. To build for Linux, pass --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu
to configure
.
If building Windows binaries, the source code must be located in a Windows- accessible directory. This is because Windows executables (such as Visual Studio and the boot JDK) must be able to access the source code. Also, the drive where the source is stored must be mounted as case-insensitive by changing either /etc/fstab or /etc/wsl.conf in WSL. Individual directories may be corrected using the fsutil tool in case the source was cloned before changing the mount options.
Note that while it's possible to build on WSL, testing is still not fully supported.
-See make/devkit/solaris11.1-package-list.txt
for a list of recommended packages to install when building on Solaris. The versions specified in this list is the versions used by the daily builds at Oracle, and is likely to work properly.
Older versions of Solaris shipped a broken version of objcopy
. At least version 2.21.1 is needed, which is provided by Solaris 11 Update 1. Objcopy is needed if you want to have external debug symbols. Please make sure you are using at least version 2.21.1 of objcopy, or that you disable external debug symbols.
Note: The Solaris port is deprecated.
Apple is using a quite aggressive scheme of pushing OS updates, and coupling these updates with required updates of Xcode. Unfortunately, this makes it difficult for a project such as the JDK to keep pace with a continuously updated machine running macOS. See the section on Apple Xcode on some strategies to deal with this.
It is recommended that you use at least Mac OS X 10.13 (High Sierra). At the time of writing, the JDK has been successfully compiled on macOS 10.12 (Sierra).
@@ -259,14 +245,10 @@xcode-select --install
It is advisable to keep an older version of Xcode for building the JDK when updating Xcode. This blog page has good suggestions on managing multiple Xcode versions. To use a specific version of Xcode, use xcode-select -s
before running configure
, or use --with-toolchain-path
to point to the version of Xcode to use, e.g. configure --with-toolchain-path=/Applications/Xcode8.app/Contents/Developer/usr/bin
If you have recently (inadvertently) updated your OS and/or Xcode version, and the JDK can no longer be built, please see the section on Problems with the Build Environment, and Getting Help to find out if there are any recent, non-merged patches available for this update.
-The minimum accepted version of the Solaris Studio compilers is 5.13 (corresponding to Solaris Studio 12.4). Older versions will not be accepted by configure.
-The Solaris Studio installation should contain at least these packages:
-Package | -Version | -
---|---|
developer/solarisstudio-124/backend | -12.4-1.0.6.0 | -
developer/solarisstudio-124/c++ | -12.4-1.0.10.0 | -
developer/solarisstudio-124/cc | -12.4-1.0.4.0 | -
developer/solarisstudio-124/library/c++-libs | -12.4-1.0.10.0 | -
developer/solarisstudio-124/library/math-libs | -12.4-1.0.0.1 | -
developer/solarisstudio-124/library/studio-gccrt | -12.4-1.0.0.1 | -
developer/solarisstudio-124/studio-common | -12.4-1.0.0.1 | -
developer/solarisstudio-124/studio-ja | -12.4-1.0.0.1 | -
developer/solarisstudio-124/studio-legal | -12.4-1.0.0.1 | -
developer/solarisstudio-124/studio-zhCN | -12.4-1.0.0.1 | -
Compiling with Solaris Studio can sometimes be finicky. This is the exact version used by Oracle, which worked correctly at the time of writing:
-$ cc -V
-cc: Sun C 5.13 SunOS_i386 2014/10/20
-$ CC -V
-CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30
The minimum accepted version of Visual Studio is 2010. Older versions will not be accepted by configure
. The maximum accepted version of Visual Studio is 2019. Versions older than 2017 are unlikely to continue working for long.
If you have multiple versions of Visual Studio installed, configure
will by default pick the latest. You can request a specific version to be used by setting --with-toolchain-version
, e.g. --with-toolchain-version=2015
.
sudo apt-get install libfreetype6-dev
.sudo yum install freetype-devel
.pkg install system/library/freetype-2
.Use --with-freetype-include=<path>
and --with-freetype-lib=<path>
if configure
does not automatically locate the platform FreeType files.
sudo apt-get install libcups2-dev
.sudo yum install cups-devel
.pkg install print/cups
.Use --with-cups=<path>
if configure
does not properly locate your CUPS files.
Certain X11 libraries and include files are required on Linux and Solaris.
+Certain X11 libraries and include files are required on Linux.
sudo apt-get install libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev
.sudo yum install libXtst-devel libXt-devel libXrender-devel libXrandr-devel libXi-devel
.pkg install x11/header/x11-protocols x11/library/libice x11/library/libpthread-stubs x11/library/libsm x11/library/libx11 x11/library/libxau x11/library/libxcb x11/library/libxdmcp x11/library/libxevie x11/library/libxext x11/library/libxrender x11/library/libxrandr x11/library/libxscrnsaver x11/library/libxtst x11/library/toolkit/libxt
.Use --with-x=<path>
if configure
does not properly locate your X11 files.
At least version 3.81 of GNU Make must be used. For distributions supporting GNU Make 4.0 or above, we strongly recommend it. GNU Make 4.0 contains useful functionality to handle parallel building (supported by --with-output-sync
) and speed and stability improvements.
Note that configure
locates and verifies a properly functioning version of make
and stores the path to this make
binary in the configuration. If you start a build using make
on the command line, you will be using the version of make found first in your PATH
, and not necessarily the one stored in the configuration. This initial make will be used as "bootstrap make", and in a second stage, the make located by configure
will be called. Normally, this will present no issues, but if you have a very old make
, or a non-GNU Make make
in your path, this might cause issues.
If you want to override the default make found by configure
, use the MAKE
configure variable, e.g. configure MAKE=/opt/gnu/make
.
On Solaris, it is common to call the GNU version of make by using gmake
.
The JDK requires GNU Bash. No other shells are supported.
At least version 3.2 of GNU Bash must be used.
@@ -865,9 +781,6 @@then the clock on your build machine is out of sync with the timestamps on the source files. Other errors, apparently unrelated but in fact caused by the clock skew, can occur along with the clock skew warnings. These secondary errors may tend to obscure the fact that the true root cause of the problem is an out-of-sync clock.
If you see these warnings, reset the clock on the build machine, run make clean
and restart the build.
On Solaris, you might get an error message like this:
-Trouble writing out table to disk
-To solve this, increase the amount of swap space on your build machine.
On Windows, you might get error messages like this:
fatal error - couldn't allocate heap
cannot create ... Permission denied
@@ -919,7 +832,7 @@
If you are prepared to take some risk of an incorrect build, and know enough of the system to understand how things build and interact, you can speed up the build process considerably by instructing make to only build a portion of the product.
Building Individual Modules
The safe way to use fine-grained make targets is to use the module specific make targets. All source code in the JDK is organized so it belongs to a module, e.g. java.base
or jdk.jdwp.agent
. You can build only a specific module, by giving it as make target: make jdk.jdwp.agent
. If the specified module depends on other modules (e.g. java.base
), those modules will be built first.
-You can also specify a set of modules, just as you can always specify a set of make targets: make jdk.crypto.cryptoki jdk.crypto.ec jdk.crypto.mscapi jdk.crypto.ucrypto
+You can also specify a set of modules, just as you can always specify a set of make targets: make jdk.crypto.cryptoki jdk.crypto.ec jdk.crypto.mscapi
Building Individual Module Phases
The build process for each module is divided into separate phases. Not all modules need all phases. Which are needed depends on what kind of source code and other artifact the module consists of. The phases are: