Can you try to install Java 8 instead? I have just tried fresh 4.0.3 install a few times and it worked fine for me.
the documentation for the first login is a little bit misleading. I solved the problem with new setup (setup=false in openfire.xml) now, by connection to the mysql database (openfire) and then I could login.
One of the problem is, to know to do not login with the email adress as user, but to do it with user "admin".
No restart of openfire was needed!
ubuntu 16.04, jre 9, mysql (newest version) and openfire 4.0.3 is working fine.