This question is inspired from my question on SU. The structure display above actually is not really important because I'm not sure if I can get what I want using find. What I need is just get the path so that I can set my TextMate to run NetBeans' Java instead of /usr/bin/java from my Mac OS X 10.5.8. Advice? Help?

1st Edit:

Thanks for answers so far, I appreciate it. Here is the result of the command I tried:

I don't understand your question. Are you looking for a file called java somewhere under a directory on your system? Are you looking for a file called java anywhere on your system? Are you trying to parse the output of tree, to extract only the parts that are the steps to a file called java? Something else?
–
GillesJul 23 '11 at 12:03

@Gilles, Thanks for your response. Right, I'm looking for a file called java with its complete absolute path somewhere under /Applications/NetBeans/NetBeans\ 7.0.app dir. I apologize for the confusion.
–
ArieJul 23 '11 at 12:09

Strictly speaking, -perm u+x selects all files that are executable by their owner, not all files that you can execute. GNU find has a -executable option to look for files that you have execute permission on, taking all file modes and ACLs into account, but this option isn't available on other systems such as OSX. In practice, this is unlikely to matter; in fact for your use case you can forget about permissions altogether and just match -name java -type f.

-type f selects only regular files, not directories or symbolic links. If you want to include symbolic links to regular files in the search, add the -L option to find (immediately after the find command, before the name of the directory to search).