On Apr 29, 2015, at 4:21 PM, Michael Hall <mik3h...@gmail.com> wrote:

> On Apr 29, 2015, at 1:16 PM, Mandy Chung <mandy.ch...@oracle.com> wrote:
> 
>>> jdeps is not the only JDK tool not in /usr/bin. The sym links from
>> /usr/bin are not created by the JDK installer.
> 
> This still seems potentially a little confusing to anyone trying to locate 
> the commands, or anyone who might just assume all commands are /usr/bin. It 
> seems harder to keep track of than it would be if everything was consistently 
> /usr/bin.

Here is a solution that I use: 

There is /usr/libexec/java_home(1) that returns the latest and greatest JDK 
installed on the system.  See man page link below for more info. 

I typically do this (can be done in a login rc file; here is a bash example) :

$ export JAVA_HOME=`/usr/libexec/java_home`/bin
$ export PATH=$PATH:$JAVA_HOME
$ which jdeps
/Library/Java/JavaVirtualMachines/jdk1.9.0.jdk/Contents/Home/bin/jdeps

If you don’t want to set JAVA_HOME variable , then you can use 
/usr/libexec/java_home —exec <cmd_name> to execute any j* command directly. 
eg:
$ /usr/libexec/java_home —exec jdeps

More information about java_home here: 
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/java_home.1.html

two cents,
- Pranav


> 
>> 
>> /usr/bin/j* are linked to
>> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands
>> probably part of OS install and I guess it's a snapshot of JDK 7
>> commands.
> 
> It does make sense that anything not here could be missed. I think, 
> originally, this goes back to the Apple JVM’s. It was probably last openjdk 
> updated as you suggest for JDK 7, or not updated at all, then it would then 
> have been last updated JDK 6 or even earlier if JDK 6 had no changes.
>  
>> 
>> If a JDK tool is added or removed for a new version of JDK, it
>> won't be reflected in /usr/bin.  You may want to follow up your
>> question from macosx-port-dev mailing list.
> 
> I can certainly do this but my understanding is that this project is no 
> longer active. It receives the occasional courtesy copy from other lists, or 
> a user question once in a while, but I didn’t think it was being actively 
> followed by anyone maintaining the JDK? No harm though I’m sure, so I’ll 
> raise the issue.
> 
> Michael Hall
> 
> 
> 
> 
> 

Reply via email to