Skip to content
Snippets Groups Projects
Select Git revision
  • bc77f025a04090734f1180be458b0cbd283d02b1
  • master default
2 results

pykat_output.kat

Blame
  • Forked from finesse / pykat
    Source project has a limited visibility.
    building.md 80.85 KiB

    % Building the JDK

    TL;DR (Instructions for the Impatient)

    If you are eager to try out building the JDK, these simple steps works most of the time. They assume that you have installed Git (and Cygwin if running on Windows) and cloned the top-level JDK repository that you want to build.

    1. Get the complete source code:
      git clone https://git.openjdk.java.net/jdk/

    2. Run configure:
      bash configure

      If configure fails due to missing dependencies (to either the toolchain, build tools, external libraries or the boot JDK), most of the time it prints a suggestion on how to resolve the situation on your platform. Follow the instructions, and try running bash configure again.

    3. Run make:
      make images

    4. Verify your newly built JDK:
      ./build/*/images/jdk/bin/java -version

    5. Run basic tests:
      make run-test-tier1

    If any of these steps failed, or if you want to know more about build requirements or build functionality, please continue reading this document.

    Introduction

    The JDK is a complex software project. Building it requires a certain amount of technical expertise, a fair number of dependencies on external software, and reasonably powerful hardware.

    If you just want to use the JDK and not build it yourself, this document is not for you. See for instance OpenJDK installation for some methods of installing a prebuilt JDK.

    Getting the Source Code

    Make sure you are getting the correct version. As of JDK 10, the source is no longer split into separate repositories so you only need to clone one single repository. At the OpenJDK Git site you can see a list of all available repositories. If you want to build an older version, e.g. JDK 11, it is recommended that you get the jdk11u repo, which contains incremental updates, instead of the jdk11 repo, which was frozen at JDK 11 GA.

    If you are new to Git, a good place to start is the book Pro Git. The rest of this document assumes a working knowledge of Git.

    Special Considerations

    For a smooth building experience, it is recommended that you follow these rules on where and how to check out the source code.

    • Do not check out the source code in a path which contains spaces. Chances are the build will not work. This is most likely to be an issue on Windows systems.

    • Do not check out the source code in a path which has a very long name or is nested many levels deep. Chances are you will hit an OS limitation during the build.

    • Put the source code on a local disk, not a network share. If possible, use an SSD. The build process is very disk intensive, and having slow disk access will significantly increase build times. If you need to use a network share for the source code, see below for suggestions on how to keep the build artifacts on a local disk.

    • On Windows, if using Cygwin, extra care must be taken to make sure the environment is consistent. It is recommended that you follow this procedure:

      • Create the directory that is going to contain the top directory of the JDK clone by using the mkdir command in the Cygwin bash shell. That is, do not create it using Windows Explorer. This will ensure that it will have proper Cygwin attributes, and that it's children will inherit those attributes.

      • Do not put the JDK clone in a path under your Cygwin home directory. This is especially important if your user name contains spaces and/or mixed upper and lower case letters.

      • You need to install a git client. You have two choices, Cygwin git or Git for Windows. Unfortunately there are pros and cons with each choice.

        • The Cygwin git client has no line ending issues and understands Cygwin paths (which are used throughout the JDK build system). However, it does not currently work well with the Skara CLI tooling. Please see the Skara wiki on Git clients for up-to-date information about the Skara git client support.

        • The Git for Windows client has issues with line endings, and do not understand Cygwin paths. It does work well with the Skara CLI tooling, however. To alleviate the line ending problems, make sure you set core.autocrlf to false (this is asked during installation).

      Failure to follow this procedure might result in hard-to-debug build problems.

    Build Hardware Requirements

    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.

    Building on x86

    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.