Compiling adoptium/temurin JDK

Dear Comunity,

I need the temurin/adoptium JDK-21 for a commercial software product, which has it as requirement. Unfortunately I haven't found this particular JDK in FreeBSD neither as precompiled nor as ports, hence I'm trying to compile the software distribution by myself.

I installed gmake and clang-compiler and gcc and downloaded the latest jdk-src tarball from https://adoptium.net/de/temurin/releases/. For configuration running

bash configure --with-toolchain-type=clang --with-boot-jdk=/usr/local/openjdk21

But the script exits with the error message:
Code:
configure: Toolchain type clang is not valid on this platform.
configure: Valid toolchains: .
configure: error: Cannot continue.
configure exiting with result code 1

This gcc as toolchain I'm getting the same result.

Has anybody comiled temurin JDK on FreeBSD successfully? What I'm doing wrong?

Many thanks for reading this post and
best regards
Paule
 
Thank you acheron for the link,

I solved the problem by adding the code

Code:
VALID_TOOLCHAINS_bsd="gcc clang"

to the file
jdk-21.0.3+9-src/make/autoconf/toolchain.m4
and running configure with the options

bash configure --with-toolchain-type=clang --with-boot-jdk=/usr/local/openjdk21 --with-cups=/usr/local --with-fontconfig=/usr/local

The script finishes without any error.
When executing

gmake all

compilation stops with error:
.../jdk-21.0.3+9-src/src/java.base/unix/classes/sun/nio/fs/UnixConstants.java.template:34:10: fatal error: 'sys/attr.h' file not found
#include <sys/attr.h>

This is a generic BSD option (supposingly for IBM aix) but I can't find any information what it's for nor what header-file is equivalent to it in freebsd.

Does anyone have an idea?

Many thanks for help
and best regards
Paule
 
Can you share your patch so that it'll benefit other people ?
 
Back
Top