问题
I would like to avoid using native libaries if at all possible. Surely there is a better way to solve this issue for Linux, Windows and Mac OS X.
回答1:
Sorry, you're out of luck. You'll need JNI, and it'll be obnoxiously different for different platforms. The base java libraries cover tasks and hardware that are pretty much universal. CD drives weren't and aren't considered so.
回答2:
You can use the Java Sound API. I believe this is part of java 5. This may allow you to do what you want to do.
http://java.sun.com/products/java-media/sound/
here are some examples:
http://www.jsresources.org/examples/
来源:https://stackoverflow.com/questions/74693/is-there-a-platform-independent-way-java-to-read-an-audio-cds-toc