Building OpenJDK On Linux

I recently loaded Asahi Linux on a M1 Mac Mini and decided I should do something more intensive than just web browsing. First test: build the latest OpenJDK.

Let’s Go

I followed the official Building The JDK page: my nature is to be impatient, so I followed the tl;dr and was successful. Perhaps later I’ll return to read the rest. Basically two steps: configure and build.

Configure Build

Despite the multiple iterations to incrementally add dependencies, it’s fairly straight-forward as the script tells you what is missing, the exception being the gcc compiler.

  1. sudo yum groupinstall "Development Tools" Don’t know what all is included but found a number of references to it
  2. git clone https://git.openjdk.org/jdk Clone the source repository.
  3. bash configure Configures the build for your environment or identifies a missing dependency
  4. sudo yum install autoconf
  5. bash configure
  6. dnf search openjdk-devel Fedora Linux comes with an installed JRE; however, a fully-baked JDK with compiler and tools is required, at least a JDK 22 for building JDK 23.
  7. sudo dnf install java-latest-openjdk-devel.aarch64 The latest named version was JDK 21; latest installs JDK 23.
  8. bash configure
  9. sudo yum install gcc-c++
  10. bash configure
  11. sudo yum install alsa-lib-devel
  12. bash configure
  13. sudo yum install cups-devel
  14. bash configure
  15. sudo yum install libXtst-devel libXt-devel libXrender-devel lib-randr-devel libXi-devel
  16. bash configure

Building Images

Very straight-forward: time make images

real 4m51.666s
user 30m27.171s
sys 1m40.516s

Final Thoughts

Much easier and much faster than expect.

Next I want to open the source in an IDE and whether I can make any sense of it, especially the C++ parts.