Error undefined symbol: JNU_ThrowByName during oracle 12c R2 installation

We faced this error during Oracle12cR2 installation.

During our installation of oracle 12.2 in new home on existing Oracle 11g installation,we faced the error

 

INFO: Executing [/opt/oracle/product/12.2.0.1/db1/bin/diagsetup, clustercheck=false, basedir=/opt/oracle/product, oraclehome=/opt/oracle/product/12.2.0.1/db1]

Solution

We found there was old 11g Database installed and all environment variables were pointing to old installation.After resetting variables to new installed ORACLE_HOME and other variable,it got resolved.