问题
We have a Java class within our Oracle DB and recently one line of code in that java class is throwing an error:
static BASE64Encoder B64 = new BASE64Encoder();
We are seeing error
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.
I wish to check the JDK version running our Oracle DB --
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production.
Thank you.
回答1:
SELECT dbms_java.get_ojvm_property(PROPSTRING=>'java.version') FROM dual
回答2:
solution 1) on the database host
cd $ORACLE_HOME/jdk/bin
java -version
solution 2) create a PL/SQL function to return Java system properties
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
select get_java_property('java.version') from dual;
solution 3) check the answer from SteveK
回答3:
Certified versions are:
Oracle 12.2 / 18.1 JVM is 1.8
The Oracle 12c database embedded JVM supports JDK 1.6 and 1.7
The Oracle 11g >= 11.2.0.4 database embedded JVM supports JDK 1.6
The Oracle 11g database embedded JVM supports JRE 1.5.
The Oracle 10g database embedded JVM supports JRE 1.4.
The Oracle 9i database embedded JVM supports JRE 1.3
来源:https://stackoverflow.com/questions/28164252/how-to-check-jdk-version-in-oracle