Java Exception: unknown protocol: udp

女生的网名这么多〃 提交于 2019-12-24 05:18:11

问题


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.


回答1:


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.




回答2:


Cause

You are using a version of the Java Developer Kit (JDK) that was released prior to JDK 1.4.



来源:https://stackoverflow.com/questions/28437232/java-exception-unknown-protocol-udp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!