Oracle JVM is compatible with the standard JLS and the JVM specifications. It supports the standard Java binary format and the standard Java APIs. In addition, Oracle Database adheres to standard Java language semantics, including dynamic class loading at run time.
See About Using Java in Oracle Database for information on Oracle Java.
Enable Oracle Java
DBMS_CLOUD_ADMIN.ENABLE_FEATURE to enable Oracle Java on Autonomous Database.
DBMS_CLOUD_ADMIN.ENABLE_FEATURE( feature_name => 'JAVAVM' ); END; /
This initiates the request to install Oracle Java on the Autonomous Database instance.
See ENABLE_FEATURE Procedure for more information.
- Restart the Autonomous Database
See Restart Autonomous Database for more information.
After you restart the Autonomous Database instance, Oracle JVM is enabled on the instance.
Check Oracle Java Version
You can check the Oracle Java version and the component registry for information on Oracle Java in the Autonomous Database instance.
- Check the component registry status and version for Oracle Java.
SELECT status, version FROM DBA_REGISTRY WHERE comp_id = 'JAVAVM'; STATUS VERSION ------ ---------- VALID 220.127.116.11.0
If Oracle Java is not installed, this query shows no rows.
- Check the Oracle Java JDK version.
SELECT dbms_java.get_jdk_version FROM DUAL; GET_JDK_VERSION --------------- 1.8.0_331
Load Java classes and JAR Files into Autonomous Database
You can use the client-side
loadjava option to load
Java classes and JAR files into Oracle JVM on an Autonomous Database instance.
loadjava option is supported as
- The JDK opens the JAR file.
- The client-side opens a communication channel with the Autonomous Database.
- The Java code is submitted to the Oracle JVM running on the Autonomous Database for loading.
This process is similar to creating a dynamic Java stored procedure from SQL code, where no file access is involved, but the code gets created.
Note the following:
The Java code you load cannot invoke any operating system or network calls.
Use of server-side
loadjava, that is calls to the procedure
dbms_java.loadjavais not supported. The procedure
dbms_java.loadjavaaccesses the file system of the database server where the Oracle JVM runs. This is not allowed on Autonomous Database and calls to the procedure
dbms_java.loadjavafrom within your Java application are not supported.
Notes for Oracle Java on Autonomous Database
Provides notes for using Oracle Java on Autonomous Database.
You cannot disable Oracle Java after it is enabled on the Autonomous Database instance.
Autonomous Database performs Oracle Java patching, as required, during the regular Autonomous Database maintenance window.
During Oracle Java patching, Java is not available and users could get an error similar to the following:
ERROR at line 1: ORA-29548: Java system class reported: release of Java system classes in the database (18.104.22.168.220118 1.8) does not match that of the oracle executable (22.214.171.124.220419 1.8).
During the maintenance window, when the Java patching phase is active there is no response for Java session calls or you see the
ORA-29548error. After the maintenance window completes, Java usage is restored.
You can use the events
ScheduledMaintenanceWarningto be notified of Oracle Java patching. See Information Events on Autonomous Database for more information.
See About Scheduled Maintenance and Patching for more information.