Problem scenario
You try to run SonarScanner or do something with SonarQube. You get a "500 Error" or some related internal server error. What should you do?
Solution
Reinstall Java. It is a dependency for SonarQube. You can keep SonarQube installed and just stop the services while you uninstall and reinstall Java. After you remove Java (and do research if you don't know how), you can use this posting if you need assistance on reinstalling Java.
If restinalling Java does not work, it is possible that you need a fresh database or you will need to reinstall SonarQube.
If you were using Jenkins and received a "500 Error", see this link.