Elasticsearch downgrade 7.1->6.7.2 fails

I stopped ES service, then used:
sudo yum remove elasticsearch

To get it out of here. I changed repos files to use 6.x versions.
Then i tried installing it with
sudo yum install elasticsearch-6.7.2

But i get this error:

could not find java; set JAVA_HOME
error: %pre(elasticsearch-0:6.7.2-1.noarch) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package elasticsearch-6.7.2-1.noarch
Verifying : elasticsearch-6.7.2-1.noarch 1/1

Failed:
elasticsearch.noarch 0:6.7.2-1

Did you install java?