opj2_compress: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/usr/bin/opj2_compress - from package: openjpeg2-tools

You may install the required package with command yum install {package}
Error in other languages:
opj2_compress: bevel nie gevind nie
opj2_compress: comandă negăsită
opj2_compress: comando não encontrado
opj2_compress: commande introuvable
opj2_compress: command not found
opj2_compress: käsku ei ole
opj2_compress: không tìm thấy lệnh
opj2_compress: komanda nerasta
opj2_compress: Kommando nicht gefunden.
opj2_compress: kommandot finns inte
opj2_compress: komut yok
opj2_compress: nie znaleziono polecenia
opj2_compress: níor aimsíodh an t-ordú
opj2_compress: no se encontró la orden
opj2_compress: no s'ha trobat l'ordre
opj2_compress: opdracht niet gevonden
opj2_compress: parancs nem található
opj2_compress: perintah tidak ditemukan
opj2_compress: príkaz nenájdený
opj2_compress: příkaz nenalezen
opj2_compress: команда не найдена
opj2_compress: командата не е открита
opj2_compress: 命令找不到
opj2_compress: コマンドが見つかりません