Christopher, Thanks, wasn't aware of /usr/libexec/java_home
$ /usr/libexec/java_home /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home $ ls -Al `/usr/libexec/java_home` total 16 drwxr-xr-x 41 root wheel 1394 Nov 21 08:43 bin lrwxr-xr-x 1 root wheel 3 Nov 21 08:42 bundle -> ../ lrwxr-xr-x 1 root wheel 51 Nov 21 08:42 include -> /System/Library/Frameworks/JavaVM.framework/Headers drwxr-xr-x 42 root wheel 1428 Nov 21 08:43 lib drwxr-xr-x 41 root wheel 1394 Nov 1 12:03 man GLOBE-Mandalay:~ cokeefe$ That path specifically says "jdk" (not "jre"). Does this mean I have a JDK rather than just a JRE? Also, would it be a good idea for the configure script to attempt to run /usr/libexec/java_home in this section where it is looking for a JDK? -Charlie On Sun, Feb 26, 2012 at 8:27 PM, Christopher Schultz < ch...@christopherschultz.net> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Charlie, > > On 2/26/12 10:07 PM, Charlie O'Keefe wrote: > > $cd native; ./configure --with-apr=`apr-1-config --prefix` checking > > build system type... x86_64-apple-darwin10.8.0 checking host system > > type... x86_64-apple-darwin10.8.0 checking target system type... > > x86_64-apple-darwin10.8.0 checking for a BSD-compatible install... > > /usr/bin/install -c checking for working mkdir -p... yes Tomcat > > Native Version: 1.1.22 checking for chosen layout... tcnative > > checking for APR... yes setting CC to "gcc" setting CPP to "gcc > > -E" checking for a BSD-compatible install... /usr/bin/install -c > > configure: error: can't locate a valid JDK location checking for > > JDK location (please wait)... checking Try to guess JDK > > location... > > > > Strange, why can't it locate a JDK? > > Are you sure you have one installed? Maybe you just have a JRE. > > You might need a package you didn't need in the past: > https://discussions.apple.com/thread/2630649?start=0&tstart=0 > > > The loop in that code which is trying a bunch of guesses will > > eventually get to the following combination of values: > > > > JAVA_PREFIX = > > /System/Library/Frameworks/JavaVM.framework/Versions/ JAVA_PLATFORM > > = 6 subversion = .0 VARIANT = "" > > > > Line 127 constructs a guess: > > GUESS="${JAVA_PREFIX}/${VARIANT}1.${JAVA_PLATFORM}${subversion}" > > > > For the above combination, that guess will be: > > /System/Library/Frameworks/JavaVM.framework/Versions//1.6.0 > > > > On my machine running OS X 10.6.8 (Snow Leopard), here's what that > > path resolves to: > > > > $ ls -l > > /System/Library/Frameworks/JavaVM.framework/Versions//1.6.0 > > lrwxr-xr-x 1 root wheel 10 Nov 21 08:42 > > /System/Library/Frameworks/JavaVM.framework/Versions//1.6.0 -> > > CurrentJDK > > > > Following the symlink: > > > > $ ls -l > > /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK > > lrwxr-xr-x 1 root wheel 59 Nov 21 08:42 > > /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK -> > > /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents > > > > Following the second symlink: > > > > $ ls -l > > /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents total > > 0 drwxr-xr-x 12 root wheel 408 Nov 21 08:43 Classes drwxr-xr-x > > 41 root wheel 1394 Nov 21 08:43 Commands drwxr-xr-x 7 root > > wheel 238 Nov 21 08:43 Home -rw-r--r-- 1 root wheel 1963 Nov > > 1 12:05 Info.plist drwxr-xr-x 50 root wheel 1700 Nov 21 08:43 > > Libraries drwxr-xr-x 3 root wheel 102 Nov 21 08:43 MacOS > > drwxr-xr-x 21 root wheel 714 Nov 21 08:43 Resources -rw-r--r-- > > 1 root wheel 454 Nov 1 12:08 version.plist > > This is what I have in my Lion environment, too. > > > So there is a directory here with some useful JDK-type things in > > it. The Home subdirectory here does look like something that would > > be universally recognized as a JAVA_HOME: > > > > $ ls -l > > /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/ > > total 16 drwxr-xr-x 41 root wheel 1394 Nov 21 08:43 bin > > lrwxr-xr-x 1 root wheel 3 Nov 21 08:42 bundle -> ../ > > lrwxr-xr-x 1 root wheel 51 Nov 21 08:42 include -> > > /System/Library/Frameworks/JavaVM.framework/Headers drwxr-xr-x 42 > > root wheel 1428 Nov 21 08:43 lib drwxr-xr-x 41 root wheel 1394 > > Nov 1 12:03 man > > I've got all that except for no "include" symlink. The target > directory in your 'ls' listing doesn't contain a 'Headers' directory, > which is probably why I don't have the symlink at all. > > > $ ls -l > > /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/ > > | grep java -rwxr-xr-x 1 root wheel 100560 Nov 1 12:03 java > > -rwxr-xr-x 1 root wheel 100560 Nov 1 12:03 javac -rwxr-xr-x 1 > > root wheel 100560 Nov 1 12:03 javadoc -rwxr-xr-x 1 root wheel > > 100560 Nov 1 12:03 javah -rwxr-xr-x 1 root wheel 100560 Nov 1 > > 12:03 javap lrwxr-xr-x 1 root wheel 67 Nov 21 08:42 javaws > > -> > > /System/Library/Java/Support/Deploy.bundle/Contents/Home/bin/javaws > > > > At the point it isn't clear to me which directory we actually > > want. This script checks for some directories that look like > > they're apple-named: > > You want the one with the header files in it. :) > > > However, this code as written will not check that location. > > > > There seem to be a few ways this could be patched to find a valid > > JDK location. May main question is, which is most preferable? My > > guess is that if JAVA_HOME has not been set, in this particular > > situation we probably want it to land on > > /System/Library/Frameworks/JavaVM.framework > > Best thing to do on Mac OS X is this: > > JAVA_HOME=`/usr/libexec/java_home` > > I still think you need to install another package, though. > > - -chris > -----BEGIN PGP SIGNATURE----- > Version: GnuPG/MacGPG2 v2.0.17 (Darwin) > Comment: GPGTools - http://gpgtools.org > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk9K+CcACgkQ9CaO5/Lv0PAxjgCfVsTN3WmI6NJzELdspLz/1vRY > vH8AnAp6PitnDmgTtJ9s0SKf1UZ9D3ZK > =EOjs > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >