Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Exception : java.lang.UnsatisfiedLinkError: ocijdbc11.dll: %1 is not a valid Win32 application

I am trying to make a connection to oracle through java program. Following is the configuration.

  1. Windows 7, 64 bit.
  2. JDK 1.6
  3. Oracle client 11g R2, 64 bit.
  4. ojdbc6.jar in the class path of my standalone application.

But I am getting following exception- "java.lang.UnsatisfiedLinkError: \bin\ocijdbc11.dll: %1 is not a valid Win32 application"

I googled alot but was not able to figure out the solution.

Please help me solve this problem.

Thanks in advance.

like image 994
pun sri Avatar asked Jan 18 '12 08:01

pun sri


1 Answers

This error seems to be related with the compatibility of the OCI driver version with your Windows version.
Check if your OCI driver is compatible with a 32 bit architecture or else is for a 64 bit (and hence the error).

Here (https://forums.oracle.com/forums/thread.jspa?threadID=2189215) you can find a close related error (same error, for a different library), which finally was fixed downloading the S.O. specific version of the library and reinstalling it.

EDIT: so, after your edition, it seems that you have to install the 64 bit JDK and run your application on it, as your driver and your OS are aligned (64 bit).

like image 71
Tomas Narros Avatar answered Oct 12 '22 22:10

Tomas Narros