Mark and Sarah, hello.
> On 2015 Apr 9, at 22:41, Mark Taylor <[log in to unmask]> wrote:
>
>> The starjava script (installed into $STARLINK_DIR/starjava/bin/starjava) has
>> a list of locations it checks for java, so we can always tweak the order of
>> that if needed? Or set a different set of places to look on OS X than we do on
>> Linux.
>
> That may be a good idea.
I have not had to understand the OS X and Java story for some years, now, so I can add very little that's authoritative to this discussion.
However neither of you has so far mentioned /usr/libexec/java_home, which _I think_ is the currently-preferred mechanism for finding just where Apple/Oracle/forces-of-chaos have squirrelled your JVM this week. The Oracle downloads seem to integrate with that mechanism in the correct fashion. I've included the relevant man page below for Mark's benefit.
The documentation I can find <https://developer.apple.com/library/mac/qa/qa1170/_index.html> seems to suggest that it all just works by magic, but google suggests that this hasn't purged the world of people asking about 'java_home'.
Bon chance,
Norman
java_home(1) java_home(1)
NAME
java_home - return a value for $JAVA_HOME
SYNOPSIS
/usr/libexec/java_home [options]
DESCRIPTION
The java_home command returns a path suitable for setting the JAVA_HOME
environment variable. It determines this path from the user's enabled
and preferred JVMs in the Java Preferences application. Additional
constraints may be provided to filter the list of JVMs available. By
default, if no constraints match the available list of JVMs, the
default order is used. The path is printed to standard output.
OPTIONS
-v or --version version
Filters the returned JVMs by the major platform version in
"JVMVersion" form. Example versions: "1.5+", or "1.6*".
-a or --arch architecture
Filters the returned JVMs by the architecture they support.
Example architectures: "i386", "x86_64", or "ppc".
-d or --datamodel datamodel
Filters the returned JVMs capable of running in 32 or 64-bit
mode. Supported datamodels: "-d32" and "-d64". Specifying a
datamodel is synonymous with specifying a particular architec-
ture.
-t or --task task
Selects from the list of JVMs which can run a specific task. The
order of each of these lists is set by the Java Preferences
application. Supported tasks: "Applets", "WebStart", "Bun-
dledApp", "JNI" and "CommandLine". The default task is "Command-
Line".
-F or --failfast
Immediately fails when filters return no JVMs; does not print
out the path to the default $JAVA_HOME.
--exec command ...
Executes the command at $JAVA_HOME/bin/<command> and passes the
remaining arguments. Any arguments to select which $JAVA_HOME to
use must precede the --exec option.
-X or --xml
Prints the list of selected JVMs and associated properties as an
XML plist to stdout.
-V or --verbose
Prints the matching list of JVMs and architectures to stderr.
-h or --help
Brief usage information.
USAGE
/usr/libexec/java_home helps users set a $JAVA_HOME in their login rc
files, or provides a way for command-line Java tools to use the most
appropriate JVM which can satisfy a minimum version or architecture
requirement. The --exec argument can invoke tools in the selected
$JAVA_HOME/bin directory, which is useful for starting Java command-
line tools from launchd plists without hardcoding the full path to the
Java command-line tool.
Usage for bash-style shells:
$ export JAVA_HOME=`/usr/libexec/java_home`
Usage for csh-style shells:
% setenv JAVA_HOME `/usr/libexec/java_home`
04 August 2010 java_home(1)
--
Norman Gray : http://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK
----
Starlink User Support list
For list configuration, including subscribing to and unsubscribing from the list, see
https://www.jiscmail.ac.uk/cgi-bin/webadmin?A0=STARLINK
|