How to Install Java in Oracle Database: A Step-by-Step Guide
Error
For testing you can use simple procedure
SQL> create or replace and compile java source named hello AS
2 public class Hello {
3 public static String hello() { return "Hello!"; }
4 };
5 /
create or replace and compile java source named hello AS
*
ERROR at line 1:
ORA-29538: Java not installed
Solution
1. Check the JVM components is installed in Oracle.
select comp_name, version, status from dba_registry;
COMP_NAME VERSION STATUS
---------------------------------- ---------- ------
Oracle Workspace Manager 11.2.0.4.0 VALID
Oracle Database Catalog Views 11.2.0.4.0 VALID
Oracle Database Packages and Types 11.2.0.4.0 VALID
2. Check DBMS JAVA package present OR Check option of Java is enabled.
--return any value rather than no row
select distinct owner,name from dba_source where lower(NAME)='dbms_java';
— Need to be true
select * from v$option where parameter = ‘Java’;
Note: Component need to present for Java.3. Install JVM component with initjvm.sql file.
COMP_ID COMP_NAME VERSION STATUS
-------- ----------------------------------- ------------- ------
JAVAVM JServer JAVA Virtual Machine 11.2.0.4.0 VALID
@?\javavm\install\initjvm.sql;
4. Check the JVM Components in Oracle.
select comp_name, version, status from dba_registry;
COMP_NAME VERSION STATUS
---------------------------------- ---------- ------
Oracle Workspace Manager 11.2.0.4.0 VALID
Oracle Database Catalog Views 11.2.0.4.0 VALID
Oracle Database Packages and Types 11.2.0.4.0 VALID
JServer JAVA Virtual Machine 11.2.0.4.0 VALID
Note: No JVM in Oracle Express Edition – does not have Java support.