While running the opatchauto   command in oracle grid you may face the jdk version error as below.

root # /crsapp/app/oracle/product/grid12c/OPatch/opatchauto apply /softdump/12C_GRIDSOFT/PATCH/22191349 -analyze -ocmrf /softdump/12C_GRIDSOFT/PATCH/grid.rsp
OPatch Automation Tool
Copyright (c)2014, Oracle Corporation. All rights reserved.

OPatchauto Version : 12.1.0.1.10
OUI Version : 12.1.0.2.0
Running from : /crsapp/app/oracle/product/grid12c

opatchauto log file: /crsapp/app/oracle/product/grid12c/cfgtoollogs/opatchauto/22191349/opatch_gi_2016-04-06_09-27-57_analyze.log

NOTE: opatchauto is running in ANALYZE mode. There will be no change to your system.

OCM RSP file has been ignored in analyze mode.

Parameter Validation: Successful

Failed: JDK version is incompatible.Please use a jdk version the same as, or later than 16
The result of cluvfy command does not contain OVERALL_STATUS String.
System Configuration Collection failed: oracle.osysmodel.driver.sdk.productdriver.ProductDriverException: Unable to determine if “/crsapp/app/oracle/product/grid12c” is a shared oracle home.
Failed: JDK version is incompatible.Please use a jdk version the same as, or later than 16
The result of cluvfy command does not contain OVERALL_STATUS String.
Exception in thread “main” java.lang.RuntimeException: java.io.IOException: Stream closed
at oracle.opatchauto.gi.GILogger.writeWithoutTimeStamp(GILogger.java:432)
at oracle.opatchauto.gi.GILogger.printStackTrace(GILogger.java:447)
at oracle.opatchauto.gi.OPatchauto.main(OPatchauto.java:97)
Caused by: java.io.IOException: Stream closed
at java.io.BufferedWriter.ensureOpen(BufferedWriter.java:98)
at java.io.BufferedWriter.write(BufferedWriter.java:203)
at java.io.Writer.write(Writer.java:140)
at oracle.opatchauto.gi.GILogger.writeWithoutTimeStamp(GILogger.java:426)
… 2 more

opatchauto failed with error code 1.

 

SOLUTION:

In the above we can see we are using complete PATH for opatchauto  like /crsapp/app/oracle/product/grid12c/OPatch/opatchauto apply which is causing the error.

 

Instead of giving the complete PATH, go to that Opatch location and run the opatchauto utility as below.

 

root# cd /crsapp/app/oracle/product/grid12c/OPatch/

root# ./opatchauto apply /softdump/12C_GRIDSOFT/PATCH/22191349 -analyze -ocmrf /softdump/12C_GRIDSOFT/PATCH/grid.rsp

OUTPUT: