Well looks like this is an old question but no one has answered it yet so... better late than never I guess. I've been ripping my hair out over this too. Like you most boards just tell me too use open-jdk. what most people don't seem to understand that open-jdk and jdk-7 are not one to one mappings of each other and many tools relied upon by developers simply don't work with open-jdk. ANYWAY...
I found a solution which solved the problem for me. Hopefully it will work for you.
Best Answer
Oracle JDK 6 and 7 are not available by default in Ubuntu 16.04 repositories and requires you to add repositories for the same as follows:
You may now run your command and enjoy using Java.
If you get error while installing ppa:repository, you will need to re-install ca certificates as follows:
Once this is done try running first two commands again.