There is no built-in Java API to do this. The next best thing which people tend to do is to dump a script specific which will open/close the CD drive. This is often done with a VBS script as @Asad Rasheed has commented.
Since you ask for a JNI way of it we will also need to know what platform you are targetting. On Windows, however, you can use mciSendString() with something like:
mciSendString("set cdaudio door open", null, null, null);
If you want more control over which CD drive to open you might want to use some other function such as DeviceIoControl().
There is no built-in Java API to do this. The next best thing which people tend to do is to dump a script specific which will open/close the CD drive. This is often done with a VBS script as @Asad Rasheed has commented.
Since you ask for a JNI way of it we will also need to know what platform you are targetting. On Windows, however, you can use mciSendString() with something like:
If you want more control over which CD drive to open you might want to use some other function such as DeviceIoControl().