Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

java.net.MalformedURLException: no protocol

807589Nov 10 2008 — edited Nov 10 2008
Hi,
I have a url string and when I try to create an URL out of it this way
URL urlOfFile= new URL(uRL);
but this is throwing an java.net.MalformedURLException: no protocol....
Why do we get MalformedURLException exception and how to resolve it?

thanks
harsha hegde

Comments

EJP
Put a protocol into the URL string. What you have clearly isn't a URL string at all. It should start with http: or ftp: or file: or any of a large number of other protocol specifiers.
1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 8 2008
Added on Nov 10 2008
1 comment
545 views