root access – Installing java and running jar files

Is there a way of installing and using java 8 on an android. Using Termux is not an option because I am on android 4.4 and it requires minimum android 5.0. I do have root access. I tried to install the arm version of java using rpm, which worked but it is not usable. When I go to the bin directory and run ./java -version it gives me an error ./java: not executable : magic 7F45. Is there a way to install and run java on a rooted android phone, without the use of termux.