On 7/8/12 12:02 PM, Philip Nienhuis wrote:
> Alexander Hansen wrote:
>> On 7/6/12 2:59 PM, Philip Nienhuis wrote:
>>
>> <snip>
>>
>>> Thanks.
>>>
>>> So, where in<JAVA_HOME>/ is the libjvm.so located?
>>>
>>> I could then patch it into pre_install.m.
>>
>> There's no such thing on OS X, but:
>>
>> $ javaconfig Library
>> /System/Library/Frameworks/JavaVM.framework/Libraries/libjvm.dylib
>> $ realpath
>> /System/Library/Frameworks/JavaVM.framework/Libraries/libjvm.dylib
>> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/libclient.dylib
>>
>>
>> I.e. the real JVM library is<JAVA_HOME>/../Libraries/libclient.dylib .
> 
> Thanks.
> 
> Yet some more questions, sorry.
> 
> 1. Is this location "stable", i.e. can one rely on it to always return
> this location, or would I need to include the system calls above to find
> libclient.dylib?  (with or without filtering for "libclient.dylib")
> Or is "libclient.dylib" a sort of red herring and would other typical
> JDK files more reliably indicate a proper JDK presence?
> 
> 

<JAVA_HOME>/../Libraries/libclient.dylib is a valid path to the JVM
library on OS 10.5-10.7.  I don't have 10.8 to check _that_.

However, I've learned through much strain and strife just to use the
tools that Apple provides. ;-)  So it might be best just to use
`javaconfig Library` to extract the location of the JVM.

Similarly, `javaconfig Headers` will grab the directory for the headers,
e.g. jni.h .  These have gotten moved around by Java updates from Apple
in the past.

> 2. In an earlier mail from you, I see you had JAVA_HOME set as follows:
> From: Alexander Hansen <alexanderk.hansen@gm...> - 2012-07-06 21:45
> <quote>
> octave:1> getenv('JAVA_HOME')
> ans = /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
> </quote>
> 
> ==> Is there a particular reason to have it point all the way to
> ...../Contents/Home? (e.g., other programs needing a JAVA_HOME setting)
> IOW, would
>   '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk'
> suffice?

no.

> Or is that JAVA_HOME setting you showed simply the setting that works
> for installing the Java package?
> 

This the JAVA_HOME setting that Apple picks _currently_ (it has changed
in the past).  According to the description in 'man java_home':

The java_home command returns a path suitable for setting the JAVA_HOME
       environment variable.

Also, if you don't provide the full path all the way to Contents/Home
you wind up with a JAVA_HOME which is not analogous to what you see on
other platforms:

$ ls /System/Library/Java/JavaVirtualMachines/1.6.0.jdk
Contents

$ ls /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/
Classes  Commands  Home  Info.plist  Libraries  MacOS  Resources
version.plist

$ ls /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
bin  bundle  lib  man

> (Sorry if these are stupid questions - I know beans about Mac OSX.)
> 
> Philip

That's quite all right.  Java on OS X seems quite painful to deal with. :-)
-- 
Alexander Hansen, Ph.D.
Fink User Liaison
My package updates: http://finkakh.wordpress.com/



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to