I am trying to separate the website name from the URL. For example - if the URL is www.google.com, the output should be \"google\". I tried the below code and everything wor
Just to make @Anubhav Sarangi comment to this question an answer:
I had the same problem. Initially, I installed Java SE 10.0.1. But got similar error. Following @Anubhav Sarangi suggestion, I downloaded and installed Java SE Development Kit 8u171 which has jdk 1.8 and the problem solved.