Search code examples
javaurlexceptionudpmalformedurlexception

Java Exception: unknown protocol: udp


I am trying to run a basic java program as part of reverse engineering an application. I am getting

java.net.MalformedURLException: unknown protocol: udp

exception while running following code

public static void main(String[] args) throws MalformedURLException {
        URL url = new URL("udp://xxx.xxxx.com:1234/");
    }

Thanks in Advance.


Solution

  • the problem here is really that udp is not a protocol; it's a transport, like tcp. You can't use a tcp://host:port/ URL either.