This creates an output directory like build/linux-x64-server-release (referred to as $BUILD).
The configure script analyzes your system and selects reasonable defaults. If it fails to detect components automatically, it will exit with an error message and suggestions.
# 32-bit Windows build with custom FreeType locationbash configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32# Debug build with server JVM and DTrace enabledbash configure --enable-debug --with-jvm-variants=server --enable-dtrace# Build with specific boot JDKbash configure --with-boot-jdk=/usr/lib/jvm/java-21-openjdk
# Set complete version stringbash configure --with-version-string="21.0.1+12-custom"# Set individual version partsbash configure --with-version-opt=custom-buildbash configure --with-version-pre=eabash configure --with-version-build=42
Version parts: major, minor, security, patch, pre, opt, build
# Use a devkit for compilers, tools, and resourcesbash configure --with-devkit=/path/to/devkit# Use specific sysroot directorybash configure --with-sysroot=/path/to/sysroot
# Prepend to default path for all binariesbash configure --with-extra-path=/opt/tools/bin:/opt/gnu/bin# Prepend when searching for toolchain binaries onlybash configure --with-toolchain-path=/opt/gcc/bin
On Windows, use Unix-style paths with Cygwin, e.g., /cygdrive/c/tools
# Extra C compiler flagsbash configure --with-extra-cflags="-O3 -march=native"# Extra C++ compiler flagsbash configure --with-extra-cxxflags="-std=c++17"# Extra linker flagsbash configure --with-extra-ldflags="-Wl,-rpath,/opt/lib"
Setting CFLAGS environment variable will not work. Use --with-extra-cflags instead.
# Use specific toolchain type on Linuxbash configure --with-toolchain-type=clang# Select Visual Studio version on Windowsbash configure --with-toolchain-version=2022# Use specific Xcode on macOSbash configure --with-xcode-path=/Applications/Xcode15.4.app
# JTReg test frameworkbash configure --with-jtreg=/path/to/jtreg# Google Test framework (for Hotspot Gtest)bash configure --with-gtest=/path/to/googletest
Download JTReg from Adoptium builds.Google Test minimum version is 1.14.0.
# Set number of coresbash configure --with-num-cores=8# Set memory size (in MB)bash configure --with-memory-size=16384# Set number of build jobs directlybash configure --with-jobs=12# Set boot JDK JVM argumentsbash configure --with-boot-jdk-jvmargs="-Xmx8G"
Configure analyzes your system and selects reasonable defaults. Only override if you encounter resource problems.
# Use specific epoch timestampbash configure --with-source-date=946684800# Use ISO-8601 datebash configure --with-source-date="2000-01-01T00:00:00Z"# Use configure time (default if SOURCE_DATE_EPOCH not set)bash configure --with-source-date=current# Use version's nominal release datebash configure --with-source-date=version# Update timestamp on each make run (non-reproducible)bash configure --with-source-date=updated
Build timestamp control
# Set Hotspot build timebash configure --with-hotspot-build-time="2000-01-01T00:00:00Z"# Set copyright yearbash configure --with-copyright-year=2024# Enable reproducible build modebash configure --enable-reproducible-build
# Method 1: Use --with-conf-namebash configure --with-conf-name=fastdebug --enable-debug# Method 2: Run configure from a subdirectorymkdir -p build/my-configcd build/my-configbash ../../configure --enable-debug
# Show current configure command linemake print-configuration# Save configuration for later reusemake print-configuration > my-config.txt# Restore configurationbash configure $(cat my-config.txt)
# Manually re-run with same argumentsmake reconfigure# Automatically reconfigure when configure changesmake CONF_CHECK=auto# Or set in environmentexport CONF_CHECK=auto# Skip reconfiguration check (risky)make CONF_CHECK=ignore
Add export CONF_CHECK=auto to your .bashrc to always auto-reconfigure when needed.