java.library.path 中没有 ocijdbc9
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/919921/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
no ocijdbc9 in java.library.path
提问by Degvik
When I try to run Java application, I receive the following error:
当我尝试运行 Java 应用程序时,收到以下错误:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path
Exception in thread "main" java.lang.UnsatisfiedLinkError: 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
.
我没有一个文件ocijdbc9.*
在我的电脑上,但我ocijdbc10.dll
在%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).
%ORACLE_HOME%
正确指定,所以我认为问题在于应用程序正在搜索错误的版本(9 而不是 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?
Oracle和Java Builder都是新安装的,所以问题可能出在项目偏好上?您对如何搜索指定错误版本的地方有什么想法吗?
采纳答案by Glen
You're missing a file from your java CLASSPATH.
您的 java CLASSPATH 中缺少一个文件。
You need to add the OCI jar to your classpath.
您需要将 OCI jar 添加到您的类路径中。
For my oracle 10.0.2 install on windows it's located in
对于我在 Windows 上安装的 oracle 10.0.2,它位于
%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
如果您的应用程序需要 ocijdbc9,那么您必须从某处下载它并将其添加到 CLASSPATH。我不知道从哪里下载,试试oracle站点
回答by cagcowboy
You need to pass -Djava.library.path=YOUR_ORACLE_HOME\bin
to the JRE as a runtime parameter
您需要-Djava.library.path=YOUR_ORACLE_HOME\bin
作为运行时参数传递给 JRE
So....
所以....
java [other java switches + runtime parameters] -Djava.library.path=YOUR_ORACLE_HOME\bin run-classname
回答by gokhant
an additional tip: if you're using oci jdbc urls; it is always better to use the jar library of your oracle client version.
附加提示:如果您使用的是 oci jdbc 网址;最好使用您的 oracle 客户端版本的 jar 库。
please check this address for these libraries: http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
请检查这些库的地址:http: //www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
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 <= 1.3
例如,如果您的客户端是 Oracle 10.2.0.4,那么您最好将此客户端ojdbc14.jar
用于 java >= 1.4 和classes12.jar
java <= 1.3
note that until Oracle 11, jdbc libraries have the same names in every version such as ojdbc14.jar
and classes12.jar
.
请注意,直到 Oracle 11,jdbc 库在每个版本中都具有相同的名称,例如ojdbc14.jar
和classes12.jar
。
回答by Le Truong Uy Phu
I think it is because you have not yet installed Oracle Client. After installing it, maybe it is ok
我想是因为你还没有安装Oracle Client。安装后,也许就可以了