Java (1.6) could not be located. OPatch cannot proceed!
We get below java error, when we try to query opatch utility like lsinventory, version, apply, rollback ...etc
follow below steps/workaround for the issue
Java (1.6) could not be located
Details of error are as follows.
[SERVER1]/u01/app$ OPatch/opatch version
Java (1.6) could not be located. OPatch cannot proceed!
OPatch returns with error code = 1
[SERVER1]/u01/app$
[SERVER1]/u01/app/OPatch $
OPatch cannot proceed!
This errors are related with the Opatch version or opatch utility was downloaded for a wrong platform or using older version of opatch.
Install the latest opatch
OR
Use the JDK option like following.
Use the JDK option like following.
which java
copy the java path and go to jdk location inside java home
opatch apply -jdk <<FULL_PATH_OF_JDK>
example output as below.
Use the JDK option like following.
[SERVER1]/u01/app$
[SERVER1]/u01/app$ OPatch/opatch version
Java (1.6) could not be located. OPatch cannot proceed!
OPatch returns with error code = 1
[SERVER1]/u01/app$
[SERVER1]/u01/app/OPatch $
[SERVER1]/u01/app/OPatch $ ./opatch lsinventory -jdk /export2/jdk/ -oh /u01/app/
Oracle Interim Patch Installer version 13.9.4.2.4
Copyright (c) 2021, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app
Central Inventory : /u01/app/18c/oraInventory
from : /u01/app//oraInst.loc
OPatch version : 12.2.0.1.33
OUI version : 12.2.0.1.4
Log file location : /u01/app/cfgtoollogs/opatch/opatch2021-06-21_14-11-18PM_1.log
Lsinventory Output file location : /u01/app/cfgtoollogs/opatch/lsinv/lsinventory2021-06-21_14-11-18PM.txt
--------------------------------------------------------------------------------
ARU platform id: 226
ARU platform description:: Linux x86-64
Installed Top-level Products (1):
Oracle Database 12c 12.2.0.1.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.
[SERVER1]/u01/app/OPatch $