What to do with "no ocijdbc11 in java.library.path" SQL Developer Error

I am trying to create a TNS connection in SQL Developer on my Mac laptop (OS X 10.9.5). I get this error no ocijdbc11 in java.library.path I googled around and found out that I need to install the oracle instant client. I found client instance files here:

http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html

Files are just zip files that you need to download and extract. Then I found instructions that actually tell you what to do with zip files here:

https://docs.oracle.com/cd/E11882_01/install.112/e38228/inst_task.htm#BABHEBIG

The instructions indicate that:

Set the environment variables DYLD_LIBRARY_PATH and NLS_LANG to the full path to the instantclient_11_2 directory. For example, if you unzipped the Instant Client ZIP file to /bin/oracle , then set the DYLD_LIBRARY_PATH environment DYLD_LIBRARY_PATH to /bin/oracle/instantclient_11_2 .

Instructions that don't tell me are HOW to set persistent environment variables and how to make environment variables available to GUI tools such as SQL developer.

Has anyone got SQL Developer to work with instantclient?

+5
source share
2 answers

If you conveniently edit files, you can set the library path in the script's internal launch. I edited this via Terminal.app and vim, going to:

 cd <wherever SQL Developer was installed/unzipped> cd SQLDeveloper.app/Contents/MacOS cp -p sqldeveloper.sh sqldeveloper.sh.backup chmod o+w sqldeveloper.sh vim sqldeveloper.sh 

The file is protected by default, so I change it to write access (and first make a backup, just in case). If you skip this step, using vim you can save it with :w! to save it anyway.

Alternatively, locate the SQLDeveloper application in Finder, right-click and select “Show Package Contents”, then expand it to “Contents”> “MacOS”, right-click the sqldeveloper.sh file and select “Open With” and your favorite text editor - TextEdit will do. When the file is locked, you will be prompted to unlock it at some point - perhaps during open or first editing, but TextEdit will ask you if you want to unlock it when saving.

However, you get to the file, then you can specify the addition of a line to set / export DYLD_LIBRARY_PATH :

 #!/bin/bash # Next line added for TNS connections export DYLD_LIBRARY_PATH=/path/to/instantclient export JAVA_HOME=`/usr/libexec/java_home -v 1.7` here="${0%/*}" cd "${here}" cd ../Resources/sqldeveloper/sqldeveloper/bin bash ./sqldeveloper -clean >>/dev/null 

... where /path/to/instantclient is your unpacked directory; in the example above, it would be /bin/oracle/instantclient_11_2 . Also note that this must be a 64-bit instant client; he will complain about the wrong architecture if you try to use the 32-bit version.

Once the modified file has been saved, restart SQL Developer and your TNS connection should now work. If you want to use the TNS alias, you can also set / export the TNS_ADMIN variable, which points to the directory containing the tnsnames.ora file.

+3
source

Based on @Alex Poole's answer: In El Capitan, when SIP is enabled, this one does not work , because the DYLD_LIBRARY_PATH environment DYLD_LIBRARY_PATH not passed to the environment in which bash ./sqldeveloper (the last line of SQLDeveloper.app/Contents/MacOS/sqldeveloper.sh ) .

Solution: instead of editing the SQLDeveloper.app/Contents/MacOS/sqldeveloper.sh file SQLDeveloper.app/Contents/MacOS/sqldeveloper.sh I edited the SQLDeveloper.app/Contents/Resources/sqldeveloper/sqldeveloper/bin/sqldeveloper file and added the export DYLD_LIBRARY_PATH=/path/to/instantclient .

 #!/bin/bash export DYLD_LIBRARY_PATH=/path/to/instantclient #============================================================================= # Launcher for Oracle SQL Developer # Copyright (c) 2005, Oracle. All rights reserved. #============================================================================= ... 
+8
source

All Articles