Even with all the modifications from previous post SQLDeveloper still does not show the Reset Password... option. The reason: it just don't know about the library correctly.

First the PATH as shown in previous post is not set in an application started via launcher - It does not contain the ORACLE_HOME at all. But even as I forced that with a temporary hack it did not help; so I just can say: with OSX it's more complicated to let SQLDeveloper use the proper libraries.

As the PATH is not that important on OSX, the real issue is DYLD_LIBRARY_PATH. Regardless if it's set in /etc/profiles or ~/.profiles - they never reach an application started via launcher, probably for similar reasons like PATH shown above.

But there is hope: ORACLE_HOME as set in /etc/launchd.conf is shown in the environment of SQLDeveloper. At the end, that's all we need, now just to check where to put this little flame of hope to let it grow to a bonfire.

From now on I'm talking about SQLDeveloper 3.2.20.09! Future Versions might behave different!

The script to check is /Applications/SQLDeveloper.app/Contents/Resources/sqldeveloper/ide/bin/launcher.sh. There is a function called CheckLibraryPath() which is supposed to check for a proper LD_LIBRARY_PATH (or it's equivalences) and if not set create a proper setting. Oracle just forgot to check about OSX! I write forgot on purpose, as HP-UX is checked withif [ `uname -s` = 'HP-UX' ] and SHLIB_PATH is set instead of LD_LIBRARY_PATH.

So my solution is simple: I just enhance this function with this little patch:

In my previous post I showed how to create an universal binary for Oracle instant client so I don't need to care about 32/64 bit anymore.

Now I try to show how to set some environment variables so I only need to enter sqlplus and can start my work without preparing anything first.

I know I could do this in my local .profile, but I was looking for a more centralized way to provide them, maybe on a shared desktop where basic applications are installed just once.

This is all about OSX Mountain Lion - I'm working on 10.8.2 right now.

The variables I want to set/enhance are

PATH
That is quite simple: I just added (as root) a new line in /etc/paths:/Users/berx/instantclient_11_2

ORACLE_HOME
That was a little bit more tricky as I had to create (as root) the file first. In /etc/launchd.conf
there is one line now:setenv ORACLE_HOME /Users/berx/instantclient_11_2

DYLD_LIBRARY_PATH
If you are curious what this is used for, it's the equivalent to Linux LD_LIBRARY_PATH. This is needed for all applications which are linked dynamically. Even sqlplus is linked that way.
Unfortunately it can not be set in /etc/launchd.conf. To be more precise, it CAN be set, but it will not show up in the terminal.
Instead it will create this line at the top of each terminal window direct after it opens:dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/login) is setuid or setgid
That's due to a security setting in Mountain Lion.
I decided to use the profile for this work. In my case ~/.profile, but /etc/profile also works:# ORACLE_HOME is set in /etc/launchd.conf !!
export DYLD_LIBRARY_PATH=$ORACLE_HOME:$DYLD_LIBRARY_PATH

With these 3 little steps now I can start sqlplus directly from my terminal without caring about the environment anymore.

There is just one little drawback: all commands with setuid/setgid bit, like ps or sudo now throw a warning like this: dyld: DYLD_ environment variables being ignored because main executable (/bin/ps) is setuid or setgid
But for me this is acceptable.

The only workaround I could imagine is any kind of wrapper for sqlplus.

Recently Oracle announced a new Oracle Instant Client for OSX. As always there is a 32-bit and a 64-bit version available.
I was curious if they can be merged together to an universal binary. The short answer: yes, they can.

It all starts with downloading the instant client zips for 32 and 64 binary. I loaded basic and sqlplus and unzipped them into 2 directories instantclient_11_2_32 and instantclient_11_2_64. I also created a target directory instantclient_11_2.

So this can be seen as a short example how we can use only one ORACLE_HOME for 32 and 64 bit binaries on OSX.
But as always there is the usual disclaimer: It's not supported by Oracle; never do it on a production system (who is running anything Oracle-Related on OSX Server at all?); it's not tested with all the different applications which use oracle client.

Update 1 (2012-02-17 21:50):

If you want the binary installation more like a real ORACLE_HOME check Ronald Roods blog!