From d880b43f56748815b82bdde90684bdaff197ac1a Mon Sep 17 00:00:00 2001 From: David Goulet Date: Mon, 11 Nov 2013 12:52:23 -0500 Subject: [PATCH] Fix: java library to use user define JDK at compile time Signed-off-by: David Goulet --- liblttng-ust-java/Makefile.am | 12 +++++++++--- liblttng-ust-java/README | 14 ++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/liblttng-ust-java/Makefile.am b/liblttng-ust-java/Makefile.am index 57b95323..8bf63499 100644 --- a/liblttng-ust-java/Makefile.am +++ b/liblttng-ust-java/Makefile.am @@ -8,6 +8,12 @@ nodist_liblttng_ust_java_la_SOURCES = org_lttng_ust_LTTngUst.h dist_noinst_DATA = LTTngUst.java liblttng_ust_java_la_LIBADD = -lc -L$(top_builddir)/liblttng-ust/.libs -llttng-ust +if HAVE_JAVA_JDK +JCC=$(JAVA_JDK)/bin +else +JCC=javac +endif + all: LTTngUst.class org_lttng_ust_LTTngUst.h liblttng-ust-java.jar clean-local: @@ -18,12 +24,12 @@ clean-local: LTTngUst.c: org_lttng_ust_LTTngUst.h LTTngUst.class: LTTngUst.java - javac -d "$(builddir)" "$(srcdir)/LTTngUst.java" + $(JCC)/javac -d "$(builddir)" "$(srcdir)/LTTngUst.java" org_lttng_ust_LTTngUst.h: LTTngUst.class - javah org.lttng.ust.LTTngUst + $(JCC)/javah org.lttng.ust.LTTngUst liblttng-ust-java.jar: LTTngUst.class - jar cf liblttng-ust-java.jar org/* + $(JCC)/jar cf liblttng-ust-java.jar org/* endif diff --git a/liblttng-ust-java/README b/liblttng-ust-java/README index 4b4d2c6e..e3ad8494 100644 --- a/liblttng-ust-java/README +++ b/liblttng-ust-java/README @@ -2,15 +2,13 @@ This directory contains a simple API for instrumenting java applications. Configuration examples to build this library: -dependency: sun-java6-jdk -./configure --with-java-jdk=/usr/lib/jvm/java-6-sun --with-jni-interface - -dependency: openjdk-6-jdk -./configure --with-java-jdk=/usr/lib/jvm/java-6-openjdk --with-jni-interface - -dependency: gcj-4.4-jdk -./configure --with-java-jdk=/usr/lib/jvm/java-gcj --with-jni-interface +dependency: openjdk-7-jdk +./configure --with-java-jdk=/usr/lib/jvm/java-7-openjdk --with-jni-interface +Note that the OpenJDK 7 is used for development and continuous integration thus +we directly support that version for this library. However, it has been tested +with OpenJDK 6 also. Please let us know if other Java version (commercial or +not) work with this library. After building, you can use the liblttng-ust-java.jar file in a Java project. It requires the liblttng-ust-java.so* files (which get installed when doing -- 2.34.1