Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
RRs:
- libjvm path: https://reviews.apache.org/r/68610/
- Maven invocation: https://reviews.apache.org/r/68611/
- Fix of javah: https://reviews.apache.org/r/68612 & https://reviews.apache.org/r/68613
-
Mesosphere Sprint 2018-28
-
3
Description
There are three distinct issues with modern Java and Linux versions:
1. Mesos configure script expects `libjvm.so` at `$JAVA_HOME/jre/lib/<arch>/server/libjvm.so`, but in the newer openjdk versions, `libjvm.so` is found at `$JAVA_HOME/lib/server/libjvm.so`.
2. On some distros (e.g., Ubuntu 18.04), JAVA_HOME env var might be missing. In such cases, the configure is able to compute it by looking at `java` and `javac` paths and succeeds. However, some maven plugins require JAVA_HOME to be set and could fail if it's not found.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.8.1:jar (build-and-attach-javadocs) on project mesos: MavenReportException: Error while creating archive: Unable to find javadoc command: The environment variable JAVA_HOME is not correctly set. -> [Help 1]
Because configure scripts generate an automake variable `JAVA_HOME`, we can simply invoke maven in the following way to fix this issue:
JAVA_HOME=$JAVA_HOME mvn ...
These two behaviors were observed with OpenJDK 1.11 on Ubuntu 18.04 but I suspect that the behavior is present on other distros/OpenJDK versions.
3. `javah` has been removed as of OpenJDK 1.10. Instead `javac -h` is to be used as a replacement. See http://openjdk.java.net/jeps/313 for more details.
Attachments
Issue Links
- is duplicated by
-
MESOS-8854 Building on JDK 9+ systems fails
- Resolved