My colleague has got this error message:

$ opatch lsinventory
OPatch/opatch: line 750: bc: command not found
Invalid maximum heap size: -Xmxm
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

OPatch failed with error code 1

A "bc" is an arbitrary precision calculator language (witch is often required for math calculation in Bash scripts, when you are using floating-point numbers for example) and many of us are using the bc command as simple command-line calculator and now OPatch does it the as well. It is used just for setting maximum heap size for JRE (this is being done in setUpJREMemoryOPtions() function of opatch command) which in newer versions is using "bc" command. The idea behind this post is beacause many Linux/Unix (power) users don't know about "bc", surprisingly even some SysAdmins.

$ OPatch_old/opatch version
OPatch Version: 12.1.0.1.7

OPatch succeeded.

$ OPatch_new/opatch version
OPatch_new/opatch: line 750: bc: command not found
Invalid maximum heap size: -Xmxm
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

OPatch failed with error code 1

# rpm -ih bc-1.06.95-13.el7.x86_64.rpm
################################## [100%]
Updating / installing
################################## [100%]

$ OPatch_new/opatch version
OPatch Version: 12.1.0.1.12

OPatch succeeded.

To solve the issue simply execute (to install the bc package):

# yum install bc

and put the bc-*.rpm to your list of required packages by Oracle software.