英文:
JavaSound API not available
问题
我已经开始了一个基于OpenJDK14和OpenJFX14的新的JavaFX模块化项目。这是一个使用Maven的模块化项目。我现在遇到的问题是,我想使用Java Sound API,但无法导入任何类。
当我在Netbeans中输入:import javax.…时,没有关于javax.sound包的代码补全。我有另一个项目,同样基于OpenJDK14和OpenJFX,但它不使用Maven或模块化设计,在那里我可以导入声音库中的类。
我必须承认我对模块化设计和Maven是新手,所以也许我需要在我的pom.xml或module-info.java中进行一些配置使其工作?
英文:
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?
答案1
得分: 0
你的设置是否包括 java.desktop
模块?这是 javax.sound.sampled
库的位置。
英文:
Does your setup include the java.desktop
module? That's the location of the javax.sound.sampled
library.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论