No ocijdbc21 in java library path

What to do about «no ocijdbc11 in java.library.path» SQL Developer error

I am trying to get 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 oracle’s instant client. I found the instance client files here : http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html The files are just zip files that you need to download and extract somewhere. Then I found the instructions that actually tell you what to do with the zip files here: https://docs.oracle.com/cd/E11882_01/install.112/e38228/inst_task.htm#BABHEBIG The instructions say that :

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

What the instructions do not tell me is HOW to set environment variables permanently and how to make the environment variables accessible to GUI tools like SQL developer. Has anyone gotten SQL Developer to work with instantclient?

OK, I can get that error with connection type TNS and entering a connect identifier. Not directly relevant perhaps, but s there a reason you’re using a TNS connection type rather than a basic connection with the same connection info?

Читайте также:  Zooming in and out css

2 Answers 2

Based on the answer of @Alex Poole: In El Capitan when SIP is enabled, this doesn’t seem to work, because the DYLD_LIBRARY_PATH environment variable doesn’t get transferred to the environment that bash ./sqldeveloper starts (last line of the SQLDeveloper.app/Contents/MacOS/sqldeveloper.sh ) .

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

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

This also fixes a similar error for instantclient 12.2: no odijdbc12 in java.library.path vendor code 0

If you’re comfortable editing files, you can set the library path in the internal startup script. I edited this through Terminal.app and vim, by going to:

cd 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’m changing it to be writable (and making a backup first, just in case). If you skip that step, with vim you can save it with :w! to save it anyway.

Alternatively find the SQLDeveloper application in Finder, right click, and choose ‘Show Package Contents’, then drill down to Contents->MacOS, right-click the sqldeveloper.sh file and choose ‘Open With’ and your favourite text editor — TextEdit will do. As the file is locked you will be prompted to unlock it at some point — maybe on open or first edit, but TextEdit will ask you if you want to unlock it when you save.

However you get into the file, you can then specify add 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="$" cd "$" cd ../Resources/sqldeveloper/sqldeveloper/bin bash ./sqldeveloper -clean >>/dev/null 

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

One the modified file has been saved, relaunch SQL Developer and your TNS connection should now work. If you want to be able to use a TNS alias you can also set/export a TNS_ADMIN variable that points to a directory containing a tnsnames.ora file.

Источник

no ocijdbc9 in java.library.path

I don’t have a file ocijdbc9.* on my PC, but I have ocijdbc10.dll in %ORACLE_HOME%\bin . %ORACLE_HOME% is correctly specified, so I think the problem is that the application is searching for the wrong version (9 instead of 10). Both Oracle and Java Builder are freshly installed, so the problem may be in project preferences? Do you have any ideas on how to search for the place where the wrong version is specified?

4 Answers 4

You’re missing a file from your java CLASSPATH.

You need to add the OCI jar to your classpath.

For my oracle 10.0.2 install on windows it’s located in

%ORACLE_HOME%\jdbc\lib\ojdbc14.jar 

If your application requires ocijdbc9 then you’ll have to download it from somewhere and add it to the CLASSPATH. I don’t know where to download it from, try the oracle site

Download it from «somewhere» means download the Instant Client from the Oracle site. Just download the version corresponding to the required ocijdbc. It will contain the .dll files needed; which you need to copy to either system32 or java path. oracle.com/database/technologies/instant-client/…

an additional tip: if you’re using oci jdbc urls; it is always better to use the jar library of your oracle client version.

for example if your client is Oracle 10.2.0.4, then you’d better use this client’s ojdbc14.jar for java >= 1.4 and classes12.jar for java

note that until Oracle 11, jdbc libraries have the same names in every version such as ojdbc14.jar and classes12.jar .

You need to pass -Djava.library.path=YOUR_ORACLE_HOME\bin to the JRE as a runtime parameter

java [other java switches + runtime parameters] -Djava.library.path=YOUR_ORACLE_HOME\bin run-classname 

The error message you’re encountering suggests that the Java application is unable to find the correct version of the Oracle JDBC driver library (ocijdbc9) in the Java library path. Since you have ocijdbc10.dll in your %ORACLE_HOME%\bin directory, it’s likely that the application is indeed expecting the ocijdbc9 library and cannot locate it.

To resolve this issue, you can try the following steps:

Verify Oracle JDBC driver version compatibility: Confirm that the version of the Oracle JDBC driver you have (ocijdbc10.dll) is compatible with the Oracle database version you’re connecting to. It’s important to ensure that the driver version matches the database version to avoid any potential compatibility issues.

Update Java library path: Add the %ORACLE_HOME%\bin directory to the Java library path so that the JVM can locate the ocijdbc10.dll file. You can do this by specifying the library path using the -Djava.library.path JVM argument when running the Java application. For example:

bash Copy code java -Djava.library.path=»%ORACLE_HOME%\bin» YourApplication Replace YourApplication with the name of your Java application’s main class.

Check project configuration: Verify the project configuration or build settings to ensure that it’s not explicitly referencing the ocijdbc9 library or specifying an incorrect version. Review any project-specific configuration files or build scripts that may be setting the library path or explicitly referencing the ocijdbc9 library. Make sure these references are updated to reflect the correct version (ocijdbc10).

Check system environment variables: Double-check that the %ORACLE_HOME% environment variable is set correctly and points to the correct Oracle installation directory. Ensure that there are no conflicting or incorrect environment variables that might be interfering with the correct resolution of %ORACLE_HOME%.

Источник

Java.lang.UnsatisfiedLinkError: No Ocijdbc21 In Java.library.path only with ORDS silent installation (Doc ID 2769657.1)

the following error occurs only with silent installation and not with other options :

java.lang.UnsatisfiedLinkError: no ocijdbc21 in java.library.path

Exception in thread «main» java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at oracle.dbtools.jarcl.Entrypoint.invoke(Entrypoint.java:66)
at oracle.dbtools.jarcl.Entrypoint.main(Entrypoint.java:77)
Caused by: java.lang.UnsatisfiedLinkError: no ocijdbc21 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:4481)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:4479)
at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:504)
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:1032)
at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:84)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:681)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:602)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at oracle.dbtools.installer.config.UserConnectBase.validateBequeathConnect(UserConnectBase.java:338)
at oracle.dbtools.installer.config.UserConnect.privilegedUserConnect(UserConnect.java:

Changes


Cause

To view full details, sign in with your My Oracle Support account.

Don’t have a My Oracle Support account? Click to get started!

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.

Oracle offers a comprehensive and fully integrated stack of cloud applications and platform services. For more information about Oracle (NYSE:ORCL), visit oracle.com. � Oracle | Contact and Chat | Support | Communities | Connect with us | | | | Legal Notices | Terms of Use

Источник

no ocijdbc12 in java.library.path

ojdbc7.jar in the class path of my standalone application. But I am getting following exception:

Exception in thread 'main' java.lang.UnsatisfiedLinkError: no ocijdbc12 in java.library.path 

I tried connection using thin driver. For thin driver it is Connection Succeeded. I googled but was not able to figure out the solution.

Please help me solve this problem.

Class.forName(«oracle.jdbc.driver.OracleDriver»); try (Connection con = DriverManager.getConnection(«jdbc:oracle:oci:@hostname:port_no:xe»,»USERNAME»,»PASSWORD»))

@FlyingGuy If I am using JDBC «Thin» then for remote oracle access i want firewall permission which may not required using «OCI» so..

7 Answers 7

I had the same issue, it was just the external folder of the my *.ora files which was not there any more, I pointed to it again via (menu navigation):

It solved it!

To use the oracle OCI driver you should have the relevant dlls in your java library path.

Make sure to reference the correct release, both in term of 32/64 bit and version number.

This answer was very helpful for me, because I was using the wrong version of the ojdbc jar, so it was calling for the wrong version of the oci driver

It has been resolved by setting Oracle client

Tools -> Preference -> Database -> Advanced -> Use Oracle client -> (choose path of oracle client)

ex: Instant Client: file:/C:/Oracle/product/11.2.0/client_3/

  1. Rename the C:\Users\username\AppData\Roaming\JDeveloper\System folder
  2. Run the Project from Jdeveloper
  3. Close the Jdeveloper
  4. Rename back the System folder and try running the project and update the mapping in VO

I had a similar situation.

The solution turned out to be to enter the connection property and from this level to reconnect.

I will add that the problem appeared after the installation of oracle express during which an error occurred and the installation was not completed

For JDeveloper 12c, if you come across this issue set up an environment variable referring to ojdbc jar»

The error message may be misleading — especially when your application is correctly configured (with all jars in place etc.)

Check the tnsnames.ora file if it contains the definition for the database you try to connect to. If not, add it and restart the application.

If the definition is there but you can’t see any TNSes, check if the syntax is fine. One bracket too much and SQL Developer will ignore the whole file silently.

Источник

Оцените статью