Java 如何在 Oracle 中检查 JDK 版本?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28164252/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 05:42:56  来源:igfitidea点击:

How to check JDK version in Oracle?

javaoracleoracle11g

提问by Ravi Gupta

We have a Java class within our Oracle DB and recently one line of code in that java class is throwing an error:

我们的 Oracle DB 中有一个 Java 类,最近该 Java 类中的一行代码抛出错误:

static BASE64Encoder B64 = new BASE64Encoder();

We are seeing error

我们看到错误

java.lang.ExceptionInInitializerError

java.lang.ExceptionInInitializerError

on this line of code.

在这行代码上。

I am not sure what has changed on the DB side as we don't have SYS privileges or access to host.

我不确定 DB 端发生了什么变化,因为我们没有 SYS 权限或对主机的访问权限。

I wish to check the JDK version running our Oracle DB --

我想检查运行我们的 Oracle DB 的 JDK 版本——

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production.

Oracle 数据库 11g 企业版 11.2.0.3.0 版 - 64 位生产。

Thank you.

谢谢你。

回答by SubOptimal

solution 1)on the database host

解决方案1)在数据库主机上

cd $ORACLE_HOME/jdk/bin
java -version

solution 2)create a PL/SQL function to return Java system properties

解决方案2)创建PL/SQL函数返回Java系统属性

create function get_java_property(prop in varchar2)
return varchar2 is
language java name 'java.lang.System.getProperty(java.lang.String) return java.lang.String';

And the run a select for the Java version

然后为 Java 版本运行一个选择

select get_java_property('java.version') from dual;

solution 3)check the answer from SteveK

解决方案 3)检查SteveK的答案

回答by Ankur Singhal

Certified versions are:

认证版本为:

Oracle 12.2 / 18.1 JVM is 1.8

The Oracle 12cdatabase embedded JVM supports JDK 1.6 and 1.7

The Oracle 11g >= 11.2.0.4database embedded JVM supports JDK 1.6

The Oracle 11gdatabase embedded JVM supports JRE 1.5.

The Oracle 10gdatabase embedded JVM supports JRE 1.4.

The Oracle 9idatabase embedded JVM supports JRE 1.3

Oracle 12.2 / 18.1 JVM 是1.8

Oracle 12c数据库嵌入式JVM 支持JDK 1.6 和 1.7

Oracle 11g >= 11.2.0.4数据库内嵌JVM 支持JDK 1.6

Oracle 11g数据库嵌入式JVM 支持JRE 1.5

Oracle 10g数据库嵌入式 JVM 支持JRE 1.4

Oracle 9i数据库嵌入式 JVM 支持JRE 1.3

回答by SteveK

SELECT  dbms_java.get_ojvm_property(PROPSTRING=>'java.version') FROM dual