open-airplay icon indicating copy to clipboard operation
open-airplay copied to clipboard

Suggest more information about JMDNS

Open pmorch opened this issue 9 years ago • 6 comments

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.

pmorch avatar Apr 16 '15 08:04 pmorch

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.

sparadiso avatar Jun 11 '15 15:06 sparadiso

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>

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.

dkinon avatar Oct 12 '15 17:10 dkinon

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

exussum12 avatar Dec 16 '16 15:12 exussum12

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 @pmorch throws Error: Could not find or load main class com.Jameslow.AirPlay

brentmsmith avatar Mar 03 '17 00:03 brentmsmith

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

castarco avatar Apr 19 '18 07:04 castarco

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)

suyashcjoshi avatar Nov 02 '20 23:11 suyashcjoshi