On Fri, Dec 02, 2005 at 11:35:53AM -0800, Daniel Rall wrote:
> Well over a year ago, I sent in a patch to fix a problem Justin
> Erenkrantz noted on OS X when building with Jikes. (Possibly to do
> with finding his Java runtime JARs? He didn't specify.)
Ok, I understand what's going on now. On OS X, the shipped javac knows
how to find the Java system classes automatically, but the shipped
jikes executable (in /usr/bin/jikes) doesn't - it needs to be told via
JAVA_CLASSPATH.
Since we pick up jikes by preference, we need to fix the JAVA_CLASSPATH
logic to find the system classes on Darwin.
However, the patch doesn't work for me. I don't have JAVA_HOME set,
which means that $JDK is correctly set to /Library/Java/Home from the
start, and so the fixup logic you changed doesn't run.
Since the 'JRE lib dir' is always in the same place on Darwin (or, more
accurately, we have no better guesses for where it might be located),
why not set $JRE_LIB_DIR unconditionally on Darwin (we'll only use it
for jikes-enabled builds, of course)?
Updated patch attached. I can confirm that it appears to fix 'make
javahl' for me on OS X 10.4.3, anyway, which previously bombed out right
at the start.
Regards,
Malcolm
Index: build/ac-macros/java.m4
===================================================================
--- build/ac-macros/java.m4 (revision 17597)
+++ build/ac-macros/java.m4 (working copy)
@@ -64,6 +64,12 @@
if test "$os_arch" = "Darwin" -a "$JDK" = "/usr" -a -d "/Library/Java/Home"; then
JDK="/Library/Java/Home"
fi
+ if test "$os_arch" = "Darwin"; then
+ JRE_LIB_DIR="/System/Library/Frameworks/JavaVM.framework/Classes"
+ else
+ JRE_LIB_DIR="$JDK/jre/lib"
+ fi
+
if test -f "$JDK/include/jni.h"; then
dnl This *must* be fully expanded, or we'll have problems later in find.
JNI_INCLUDEDIR="$JDK/include"
@@ -106,8 +112,8 @@
if test -z "$jikes_found" -a -x "$jikes"; then
jikes_found="yes"
JAVAC="$jikes"
- JAVA_CLASSPATH="$JDK/jre/lib"
- for jar in $JDK/jre/lib/*.jar; do
+ JAVA_CLASSPATH="$JRE_LIB_DIR"
+ for jar in $JRE_LIB_DIR/*.jar; do
JAVA_CLASSPATH="$JAVA_CLASSPATH:$jar"
done
fi
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Dec 3 13:02:05 2005