Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check JDK version in Oracle?

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.

like image 469
Ravi Gupta Avatar asked Jan 27 '15 06:01

Ravi Gupta


People also ask

How do I check if I have JDK?

1. Open command prompt and enter “java –version”. If installed version number is displayed.

Which version of JDK is currently in use?

The latest version of Java is Java 18 or JDK 18 released on March, 22nd 2022 (follow this article to check Java version on your computer).

Does Oracle use JDK?

Oracle 12c includes SQL Devloper 3.2 I believe, so presumably includes JDK 6. They supply the old version of SQL Developer, so they also supply a matching, compatible version of the JDK, even if Java had moved on since that version of SQL Developer. The current version, SQL Developer 4.1, requires JDK 8.

How can I check my Java version?

Type "java -version" into the Command Prompt, then press Enter on your keyboard. After a moment, your screen should display the information your computer has about Java, including what version you have installed.

How to check Java version used in Oracle Database?

Check Java version used in Oracle Database Check the java JDK version present in Oracle Setup Go to the Oracle Home directory then java & bin folder and run the following command to check. E:oracle12.1.0dbhome_1jdkbin>java -version

What version of Java is used in Oracle Database 11g JDBC?

Below is from Java Developers’ Perspective on Oracle Database 11g under "Portability: Java Standards Support" section The Oracle database 11g JDBC comes in two flavors: ojdbc5.jar for Java 5 (i.e., JDK 1.5) and ojdbc6.jar for Java 6 (i.e., JDK 1.6).

What are the differences between Oracle JDK and OpenJDK?

Differences between Oracle JDK and OpenJDK 0 ORA-00932: inconsistent datatypes: expected TIMESTAMP got TIMESTAMP 0 How to define a constant in oracle? 1 Alter table in Oracle 10G - virtual column 2 Query works on a version of oracle but not on other

How to find the Java version in CMD?

To find the Java version in CMD, follow the steps given below: Step 1: Open the Command Prompt by pressing Windows Key + R, type cmd and press enter key or click on the Ok button. It opens the Command Prompt window.


2 Answers

SELECT  dbms_java.get_ojvm_property(PROPSTRING=>'java.version') FROM dual
like image 154
SteveK Avatar answered Sep 24 '22 19:09

SteveK


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

like image 42
SubOptimal Avatar answered Sep 22 '22 19:09

SubOptimal