weixin_39547392
2020-11-28 09:04 阅读 1

Suggest more information about JMDNS

I got JMDNS working but not without poking around, and I suggest that some more detailed explanation of accomplishing this is mentioned. E.g. I couldn't get this suggested approach to work:


java -jar airplay.jar

Instead this worked for me:

Download jmdns.jar e.g. from this zip file. Then run:


java -cp airplay.jar:jmdns.jar com.jameslow.AirPlay -d

I'm not sure if this is the best way to do it. But some more documentation on this would've been nice.

该提问来源于开源项目:openairplay/open-airplay

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

6条回答 默认 最新

  • weixin_39548968 weixin_39548968 2020-11-28 09:04

    Seconded - running

    
    java -jar build/airplay.jar
    

    or

    
    java -cp lib/jmds.jar -jar build/airplay.jar
    

    result in

    
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/jmdns/JmDNS
        at com.jameslow.AirPlay.search(Unknown Source)
        at com.jameslow.AirPlay.search(Unknown Source)
        at com.jameslow.AirPlay.searchDialog(Unknown Source)
        at com.jameslow.AirPlay.searchDialog(Unknown Source)
        at com.jameslow.AirPlay.main(Unknown Source)
     Caused by: java.lang.ClassNotFoundException: javax.jmdns.JmDNS
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    

    pmorch's solution worked for me, although I openly admit this is probably due to my limited understanding of the Java runtime.

    点赞 评论 复制链接分享
  • weixin_39915081 weixin_39915081 2020-11-28 09:04

    pmorch's solution worked for me as well with one exception. The jmdns.jar download link provided points to an older version of the jar file that caused me to get the following repeating warnings and never actually get a list of AppleTVs:

    
    <date> AM javax.impl.DNSIncoming readAnswer
    WARNING: There was an OPT answer. Not currently handled.  Option code: 65002 data: <hex>
    </hex></date>

    A better source for this jar file is the official release page for jmdns.org: https://github.com/openhab/jmdns/releases . Downloading jmdns-3.4.2.jar fixed the issue I mention above... I have a feeling this is related to the moving target that is AppleTV updates but I don't know for sure.

    点赞 评论 复制链接分享
  • weixin_39880895 weixin_39880895 2020-11-28 09:04

    Running ant jarbundle did fix this for me. Though now no errors show and nothing is discovered

    点赞 评论 复制链接分享
  • weixin_39658966 weixin_39658966 2020-11-28 09:04

    So what's the correct way to run the airplay jar file now? Only jar file in master is the jmdns.jar and the above command from throws Error: Could not find or load main class com.Jameslow.AirPlay

    点赞 评论 复制链接分享
  • weixin_39928017 weixin_39928017 2020-11-28 09:04

    I'm suffering the same problem as , java tells that's unable to find the com.jameslow.AirPlay .

    点赞 评论 复制链接分享
  • weixin_39769091 weixin_39769091 2020-11-28 09:04

    go to the java directory and run this command : ant build jarbundle run and that should run the server, though the client (iPhone mirroring is not showing it)

    点赞 评论 复制链接分享

相关推荐