Skip to content

obi java agent build fails on macos #1246

@esara

Description

@esara

Build fails because the native JNI build uses the Linux include path on macOS; jni_md.h lives in the platform-specific include dir (e.g. darwin on macOS). On macOS that file lives under include/darwin, so the compiler couldn’t find it.

$ cd pkg/internal/java
$ ./gradlew :loader:build

> Task :agent:buildNativeLib FAILED
clang -fPIC -O2 -Wall -Wextra -Wno-unused-parameter -I/Library/Java/JavaVirtualMachines/jdk-25.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-25.0.2.jdk/Contents/Home/include/linux -Ibuild/generated/jni-headers -Isrc/main/c -c src/main/c/io_opentelemetry_obi_java_jni.c -o build/io_opentelemetry_obi_java_jni.o
In file included from src/main/c/io_opentelemetry_obi_java_jni.c:6:
/Library/Java/JavaVirtualMachines/jdk-25.0.2.jdk/Contents/Home/include/jni.h:45:10: fatal error: 'jni_md.h' file not found
   45 | #include "jni_md.h"
      |          ^~~~~~~~~~
1 error generated.
make: *** [build/io_opentelemetry_obi_java_jni.o] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions