Haven't tried it, but it seems you can specify which version of java you want to use:
How can I run different versions of Java on the same computer?
I'm on a fresh install of Bodhi Linux 5.0, Open JDK 10.0.2, and I'm getting the same error message as the OP.