How does Java Sound know about plug-ins (a.k.a. “service providers”)?
If installed correctly, plug-ins are recognized automatically by the runtime initialisation system of Java Sound. It scans the classpath for configuration files like /META-INF/services/javax.sound.midi.spi.MidiDeviceProvider. Since the method ClassLoader.getResources() is used for this, multiple locations can be returned. To make it work the desired way, the service providers are packaged into a .jar together with such a configuration file. The configuration file just contains fully qualified class names. See also Appendix 1: Code Overview: AudioSystem.java By the way, this mechanism is not Java Sound specific: it’s also used for I/O encoding handling, image I/O and several other locations.