Discussions
Categories
- 196.9K All Categories
- 2.2K Data
- 239 Big Data Appliance
- 1.9K Data Science
- 450.3K Databases
- 221.7K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 550 MySQL Community Space
- 478 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 545 SQLcl
- 4K SQL Developer Data Modeler
- 187K SQL & PL/SQL
- 21.3K SQL Developer
- 295.9K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.6K Development Tools
- 107 DevOps
- 3.1K QA/Testing
- 646K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 155 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 18 Java Essentials
- 160 Java 8 Questions
- 86K Java Programming
- 80 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 439 LiveLabs
- 38 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 171 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 232 Portuguese
Error loading the native OCI library on OS X using 12.1.0.2.0

Good morning,
I am attempting to leverage the OCI/Thick driver in SQL Developer 4.1.1 running on OS X Yosemite (10.10.5).
For clarity, I've downloaded the 64bit drivers
- instantclient-basic-macos.x64-12.1.0.2.0.zip
- instantclient-sqlplus-macos.x64-12.1.0.2.0.zip
- instantclient-odbc-macos.x64-12.1.0.2.0.zip
and have extracted them to /Applications/instantclient_12_1
I've also followed the directions at the end for 12_1 (Instant Client downloads for Mac OS X (Intel x86) ) for creating the soft links.
Below is my general configuration.
[09:29 AM] [email protected] /Applications/instantclient_12_1 # echo $DYLD_LIBRARY_PATH /Applications/instantclient_12_1[09:29 AM] [email protected] /Applications/instantclient_12_1 # echo $PATH/opt/local/bin:/opt/local/sbin:/Applications/instantclient_12_1:/opt/local/bin:/opt/local/sbin:/Applications/instantclient_12_1:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin[09:29 AM] [email protected] /Applications/instantclient_12_1 # echo $TNS_ADMIN /Applications/instantclient_12_1/network/admin[09:30 AM] [email protected] /Applications/instantclient_12_1 # file /Applications/instantclient_12_1/*/Applications/instantclient_12_1/BASIC_README: ASCII text/Applications/instantclient_12_1/ODBC_IC_Readme_Unix.html: HTML document text/Applications/instantclient_12_1/SQLPLUS_README: ASCII text/Applications/instantclient_12_1/adrci: Mach-O 64-bit executable x86_64/Applications/instantclient_12_1/genezi: Mach-O 64-bit executable x86_64/Applications/instantclient_12_1/glogin.sql: ASCII English text/Applications/instantclient_12_1/jdbc: directory/Applications/instantclient_12_1/libclntsh.dylib: Mach-O 64-bit dynamically linked shared library x86_64/Applications/instantclient_12_1/libclntsh.dylib.12.1: Mach-O 64-bit dynamically linked shared library x86_64/Applications/instantclient_12_1/libclntshcore.dylib.12.1: Mach-O 64-bit dynamically linked shared library x86_64/Applications/instantclient_12_1/libnnz12.dylib: Mach-O 64-bit dynamically linked shared library x86_64/Applications/instantclient_12_1/libocci.dylib: Mach-O 64-bit dynamically linked shared library x86_64/Applications/instantclient_12_1/libocci.dylib.12.1: Mach-O 64-bit dynamically linked shared library x86_64/Applications/instantclient_12_1/libociei.dylib: Mach-O 64-bit bundle x86_64/Applications/instantclient_12_1/libocijdbc12.dylib: Mach-O 64-bit bundle x86_64/Applications/instantclient_12_1/libons.dylib: Mach-O 64-bit dynamically linked shared library x86_64/Applications/instantclient_12_1/liboramysql12.dylib: Mach-O 64-bit dynamically linked shared library x86_64/Applications/instantclient_12_1/libsqlplus.dylib: Mach-O 64-bit dynamically linked shared library x86_64/Applications/instantclient_12_1/libsqlplusic.dylib: Mach-O 64-bit bundle x86_64/Applications/instantclient_12_1/libsqora.dylib.12.1: Mach-O 64-bit dynamically linked shared library x86_64/Applications/instantclient_12_1/network: directory/Applications/instantclient_12_1/odbc_update_ini.sh: POSIX shell script text executable/Applications/instantclient_12_1/ojdbc6.jar: Zip archive data, at least v1.0 to extract/Applications/instantclient_12_1/ojdbc7.jar: Zip archive data, at least v1.0 to extract/Applications/instantclient_12_1/sqlplus: Mach-O 64-bit executable x86_64/Applications/instantclient_12_1/uidrvci: Mach-O 64-bit executable x86_64/Applications/instantclient_12_1/xstreams.jar: Zip archive data, at least v1.0 to extract
When I configure SQL Developer to use the OCI/Thick client:
I receive the following message:
Testing the Instant Client located at /Applications/instantclient_12_1Testing client directory ... OKTesting loading Oracle JDBC driver ... OKTesting checking Oracle JDBC driver version ... OK Driver version: 12.1.0.2.0Testing testing native OCI library load ... Failed: Error loading the native OCI library The native OCI driver could not be loaded. The system propertyjava.library.path contains the entries from the environment variable DYLD_LIBRARY_PATH. Check it to verify that the expected native library directory /Applications/instantclient_12_1 is present and precedes any other client installations. java.library.path = /Users/cjtravis/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
I've spent more time than I'd like to admit troubleshooting this issue. I've set my $DYLD_LIBRARY_PATH with no luck.
Any feedback is appreciated. Have I overlooked a painfully obvious configuration setting somewhere? Thanks in advance.
Answers
-
What bit is your sql developer (32 or 64bit)? This error happens when you have a Driver that is 32 bit, but your SQL Developer install has a 64 Bit JDK.
If that's the case, then you'll need to install a 64 bit Client Driver to match your sql developer 64 bit JDK .
-
that's usually a different error, and it's kinda hard to get a 32 bit java going on a mac, but always good to check to make sure
-
What is the most efficient way to verify the architecture (32v64) of SQL Developer on OS X? The driver client libraries are 64bit.
-
From what you posted, it seems that java.library.path does not begin with contain the instant client location as required by the message...
Check it to verify that the expected native library directory /Applications/instantclient_12_1 is present and precedes any other client installations.
I don't have a Mac, but under Windows we solve this by prepending the PATH environment variable with the instant client, but which you show as being the third directory...
# echo $PATH /opt/local/bin:/opt/local/sbin:/Applications/instantclient_12_1:..
-
Hi Gary. Thanks for the response. I updated the $PATH again to ensure the instant client path was first and tried again, producing the same results. It's as if SQL Developer isn't picking up the path properly.
Path:
[11:08 AM] [email protected] ~
# echo $PATH
/Applications/instantclient_12_1:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Results:
Testing the Instant Client located at /Applications/instantclient_12_1
Testing client directory ... OK
Testing loading Oracle JDBC driver ... OK
Testing checking Oracle JDBC driver version ... OK
Driver version: 12.1.0.2.0
Testing testing native OCI library load ... Failed:
Error loading the native OCI library
The native OCI driver could not be loaded. The system propertyjava.library.path contains the entries from the environment variable DYLD_LIBRARY_PATH. Check it to verify that
the expected native library directory /Applications/instantclient_12_1 is present and precedes any other client installations.
java.library.path = /Users/cjtravis/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
-
It's as if SQL Developer isn't picking up the path properly.
So it would seem -- very strange. If you check the jdbc.library property in Help > About > Properties does it point to an ojdbc jar file in your SQL Developer installation or to somewhere else?
Since I only have access to Windows and Oracle Linux I may not be of much more help. I did notice, however, that the instant client install example used the home directory rather than /Applications. You might review your install steps.
-
Looks like it points to a valid jar to me. I've always kept it in /Applications to prevent myself from accidentally dropping the folder in the future. I don't *think* being in the /Applications directory would impact this sort of thing, much like on Linux.
-
On my prior post I began to ponder how it seemed like SQL Developer wasn't "picking up" the DYLD_LIBRARY_PATH although I had it set as an environment variable. I decided to take a look at the shell script responsible for launching the application to see if it offered any hints.
On my local device this is located at: /Applications/SQLDeveloper 4.1.1.app/Contents/MacOS
In this directory is the script sqldeveloper.sh with the following contents:
#!/bin/bash export JAVA_HOME=`/usr/libexec/java_home -v 1.8`here="${0%/*}"cd "${here}"cd ../Resources/sqldeveloper/sqldeveloper/binbash ./sqldeveloper >>/dev/null
I added the variable for DYLD_LIBRARY_PATH (line 04) on a whim and gave it another shot:
#!/bin/bash export JAVA_HOME=`/usr/libexec/java_home -v 1.8`export DYLD_LIBRARY_PATH=/Applications/instantclient_12_1here="${0%/*}"cd "${here}"cd ../Resources/sqldeveloper/sqldeveloper/binbash ./sqldeveloper >>/dev/null
After launching SQL Developer things appear to be working!
Testing Results:
Testing the Instant Client located at /Applications/instantclient_12_1Testing client directory ... OKTesting loading Oracle JDBC driver ... OKTesting checking Oracle JDBC driver version ... OK Driver version: 12.1.0.2.0Testing testing native OCI library load ... OKSuccess!
Property validation:
And hey, the password reset prompt works, too!
Thanks for the help and feedback today -- much appreciated!
-
Thanks for the feedback -- it helps us learn, too. It looks like this may be the explanation:
https://github.com/oracle/node-oracledb/issues/231
Which may be why I also ran across some blogs describing how to get Oracle Instant Client SQL*Plus and other features to work without setting DYLD_LIBRARY_PATH at all.
-
There is an easier way to get InstantClient 12.1 to work on the Mac - one that does not involve editing any files inside the SQLDeveloper.app file.
At startup, SQL Developer will read an additional configuration file from the user's home directory. We look for the file ~/.sqldeveloper/<version>/sqldeveloper.conf. By default this file doesn't exist, but it can be created to specify additional user-specific configuration options. You can find the exact path that SQL Developer is expecting by looking at the tool.user.conf property value in the Properties tab of the About Box.
As I mentioned, this file probably doesn't exist. So create the file and add the following line to it:
AddVMOption -Djava.library.path=<instant client directory>
This will explicitly set the java.library.path to the instant client directory. SQL Developer will now be able to load the OCI libraries.
A couple of caveats:
- The Test button in the Oracle Home configuration dialog won't work correctly. It's trying to use the default java.library.path, and not the path that SQL Developer is actually using. That's something we'll need to fix in a future release.
- The default entries in the java.library.path are not going to be present. In the majority of cases, that won't be an issue, as those directories are likely empty or don't even exist. The libraries Java needs are on a different path, so only third-party libraries should be using the default directories.
I tested this with 4.1.5 on El Capitan (10.11.6), but it should work on Yosemite or Sierra and with 4.1.3 or the Early Access release of 4.2
- John
SQL Developer Team