Here's what happened to me. I had installed the DB Connect app before installing the Oracle JDK version 1.8. After installing the right JDK and correcting your Java path (and getting that error), you need to restart Splunk one more time. Seems that Splunk will only do the initial Task Server startup on Splunk startup.
After restarting Splunk, I had a running Task Server and everything was okay.