JavaSound API不可用

huangapple go评论73阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2020年9月3日 13:33:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/63717441.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定