How to Use Sun. Audio with Java 9

How to Use Sun. Audio with Java 9

i am working on adapting my desktop app to run with jre9 i get

java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: sun/audio/AudioStream

i had some other problems with sun API that i resolved by adding the jvm args --add-exports= --add-exports= but in those cases the error was of type java.lang.IllegalAccessError so exporting the model solved the problem.

any idea how can keep using the sun.audio? of course i can try to switch to a different library like javax.sound but i have some legacy code that i rather not touch.

i tried some options like --add-open and --illegal-access but assuming the sun.audio api was removed form the sdk those options won't make any difference

3

1 Answer

As Alan Bateman commented, sun.audio packages were removed from jdk9.

I ended up replacing the usage of the sun.audio package in my code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.