Java – getting java exception: java.net.MalformedURLException: no protocol

iojavaurl

I am currently calling the following line of code:

java.net.URL connection_url = new java.net.URL("http://<ip address>:<port>/path");

and I get the exception above when it executes. Any ideas as to why this is happening?

Best Solution

As a side note, you should be using URI because Java URL class is screwed up. (The equals method I believe)