Skip to content
Advertisement

JavaSound API not available

I have started a new modular JavaFX project based on OpenJDK14 and OpenJFX14. This is a modular project with maven. I now have the problem that I would like to use the Java Sound API but cannot import any classes.

When I type (inside Netbeans): import javax. … there is no code completion for the package javax.sound. I have another project, also based on OpenJDK14 and OpenJFX but does not use Maven or a modular design and there I can import the classes from the sound library.

I have to commit that I’m new to modular design and Maven, so maybe there is something I have to configure in my pom.xml or in the module-info.java to make this work?

Advertisement

Answer

Does your setup include the java.desktop module? That’s the location of the javax.sound.sampled library.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement