419 JDK binaries for Linux, Windows and macOS can be downloaded from
420 [jdk.java.net](http://jdk.java.net). An alternative is to download the
421 [Oracle JDK](http://www.oracle.com/technetwork/java/javase/downloads). Another
422 is the [Adopt OpenJDK Project](https://adoptopenjdk.net/), which publishes
423 experimental prebuilt binaries for various platforms.
424
425 On Linux you can also get a JDK from the Linux distribution. On apt-based
426 distros (like Debian and Ubuntu), `sudo apt-get install openjdk-<VERSION>-jdk`
427 is typically enough to install a JDK \<VERSION\>. On rpm-based distros (like
428 Fedora and Red Hat), try `sudo yum install java-<VERSION>-openjdk-devel`.
429
430 ## External Library Requirements
431
432 Different platforms require different external libraries. In general, libraries
433 are not optional - that is, they are either required or not used.
434
435 If a required library is not detected by `configure`, you need to provide the
436 path to it. There are two forms of the `configure` arguments to point to an
437 external library: `--with-<LIB>=<path>` or `--with-<LIB>-include=<path to
438 include> --with-<LIB>-lib=<path to lib>`. The first variant is more concise,
439 but require the include files an library files to reside in a default hierarchy
440 under this directory. In most cases, it works fine.
441
442 As a fallback, the second version allows you to point to the include directory
443 and the lib directory separately.
444
445 ### FreeType
446
447 FreeType2 from [The FreeType Project](http://www.freetype.org/) is not required
448 on any platform. The exception is on Unix-based platforms when configuring such
449 that the build artifacts will reference a system installed library,
450 rather than bundling the JDK’s own copy.
451
452 * To install on an apt-based Linux, try running `sudo apt-get install
453 libfreetype6-dev`.
454 * To install on an rpm-based Linux, try running `sudo yum install
455 freetype-devel`.
456 * To install on Solaris, try running `pkg install system/library/freetype-2`.
457
458 Use `--with-freetype-include=<path>` and `--with-freetype-lib=<path>`
459 if `configure` does not automatically locate the platform FreeType files.
460
461 ### CUPS
462
463 CUPS, [Common UNIX Printing System](http://www.cups.org) header files are
464 required on all platforms, except Windows. Often these files are provided by
465 your operating system.
466
467 * To install on an apt-based Linux, try running `sudo apt-get install
468 libcups2-dev`.
469 * To install on an rpm-based Linux, try running `sudo yum install
470 cups-devel`.
569 The JDK requires [GNU Bash](http://www.gnu.org/software/bash). No other shells
570 are supported.
571
572 At least version 3.2 of GNU Bash must be used.
573
574 ## Running Configure
575
576 To build the JDK, you need a "configuration", which consists of a directory
577 where to store the build output, coupled with information about the platform,
578 the specific build machine, and choices that affect how the JDK is built.
579
580 The configuration is created by the `configure` script. The basic invocation of
581 the `configure` script looks like this:
582
583 ```
584 bash configure [options]
585 ```
586
587 This will create an output directory containing the configuration and setup an
588 area for the build result. This directory typically looks like
589 `build/linux-x64-normal-server-release`, but the actual name depends on your
590 specific configuration. (It can also be set directly, see [Using Multiple
591 Configurations](#using-multiple-configurations)). This directory is referred to
592 as `$BUILD` in this documentation.
593
594 `configure` will try to figure out what system you are running on and where all
595 necessary build components are. If you have all prerequisites for building
596 installed, it should find everything. If it fails to detect any component
597 automatically, it will exit and inform you about the problem.
598
599 Some command line examples:
600
601 * Create a 32-bit build for Windows with FreeType2 in `C:\freetype-i586`:
602 ```
603 bash configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32
604 ```
605
606 * Create a debug build with the `server` JVM and DTrace enabled:
607 ```
608 bash configure --enable-debug --with-jvm-variants=server --enable-dtrace
609 ```
610
|
419 JDK binaries for Linux, Windows and macOS can be downloaded from
420 [jdk.java.net](http://jdk.java.net). An alternative is to download the
421 [Oracle JDK](http://www.oracle.com/technetwork/java/javase/downloads). Another
422 is the [Adopt OpenJDK Project](https://adoptopenjdk.net/), which publishes
423 experimental prebuilt binaries for various platforms.
424
425 On Linux you can also get a JDK from the Linux distribution. On apt-based
426 distros (like Debian and Ubuntu), `sudo apt-get install openjdk-<VERSION>-jdk`
427 is typically enough to install a JDK \<VERSION\>. On rpm-based distros (like
428 Fedora and Red Hat), try `sudo yum install java-<VERSION>-openjdk-devel`.
429
430 ## External Library Requirements
431
432 Different platforms require different external libraries. In general, libraries
433 are not optional - that is, they are either required or not used.
434
435 If a required library is not detected by `configure`, you need to provide the
436 path to it. There are two forms of the `configure` arguments to point to an
437 external library: `--with-<LIB>=<path>` or `--with-<LIB>-include=<path to
438 include> --with-<LIB>-lib=<path to lib>`. The first variant is more concise,
439 but require the include files and library files to reside in a default
440 hierarchy under this directory. In most cases, it works fine.
441
442 As a fallback, the second version allows you to point to the include directory
443 and the lib directory separately.
444
445 ### FreeType
446
447 FreeType2 from [The FreeType Project](http://www.freetype.org/) is not required
448 on any platform. The exception is on Unix-based platforms when configuring such
449 that the build artifacts will reference a system installed library,
450 rather than bundling the JDK's own copy.
451
452 * To install on an apt-based Linux, try running `sudo apt-get install
453 libfreetype6-dev`.
454 * To install on an rpm-based Linux, try running `sudo yum install
455 freetype-devel`.
456 * To install on Solaris, try running `pkg install system/library/freetype-2`.
457
458 Use `--with-freetype-include=<path>` and `--with-freetype-lib=<path>`
459 if `configure` does not automatically locate the platform FreeType files.
460
461 ### CUPS
462
463 CUPS, [Common UNIX Printing System](http://www.cups.org) header files are
464 required on all platforms, except Windows. Often these files are provided by
465 your operating system.
466
467 * To install on an apt-based Linux, try running `sudo apt-get install
468 libcups2-dev`.
469 * To install on an rpm-based Linux, try running `sudo yum install
470 cups-devel`.
569 The JDK requires [GNU Bash](http://www.gnu.org/software/bash). No other shells
570 are supported.
571
572 At least version 3.2 of GNU Bash must be used.
573
574 ## Running Configure
575
576 To build the JDK, you need a "configuration", which consists of a directory
577 where to store the build output, coupled with information about the platform,
578 the specific build machine, and choices that affect how the JDK is built.
579
580 The configuration is created by the `configure` script. The basic invocation of
581 the `configure` script looks like this:
582
583 ```
584 bash configure [options]
585 ```
586
587 This will create an output directory containing the configuration and setup an
588 area for the build result. This directory typically looks like
589 `build/linux-x64-server-release`, but the actual name depends on your specific
590 configuration. (It can also be set directly, see [Using Multiple
591 Configurations](#using-multiple-configurations)). This directory is referred to
592 as `$BUILD` in this documentation.
593
594 `configure` will try to figure out what system you are running on and where all
595 necessary build components are. If you have all prerequisites for building
596 installed, it should find everything. If it fails to detect any component
597 automatically, it will exit and inform you about the problem.
598
599 Some command line examples:
600
601 * Create a 32-bit build for Windows with FreeType2 in `C:\freetype-i586`:
602 ```
603 bash configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32
604 ```
605
606 * Create a debug build with the `server` JVM and DTrace enabled:
607 ```
608 bash configure --enable-debug --with-jvm-variants=server --enable-dtrace
609 ```
610
|