sqlcl java errors under different database homes

When trying to run the sqlcl version 22.1 on my new laptop (Windows 11 with many oracle database homes), I got the following errors:

I have many oracle homes on my machine (Oracle Database 12cR1, 12cR2, 18c, 19c & 21c).

After long research, it looks like that sqlcl pick the JRE under the environment ORACLE_HOME.

So, to fix the above errors, you have three options:
1- Don’t set the Oracle environment at all, and launch the sqlcl, it will pick the JRE under “C:\Program Files\Java\jdk-11.0.16”, which I’m assuming the latest one compared to that under all oracle homes.
2- Set the ORACLE_HOME to whatever environment you want, but set the JAVA_HOME as follows:
set JAVA_HOME=C:\Program Files\Java\jdk-11.0.16
3- Edit the sqlcl script and comment the function that enforces the use of the jre on the ORACLE_HOME.

If I want with the second option:

This fixed my issue.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s