How can I close the CD-ROM tray, using Java API or JNI?
Is it possible at all to interact with cd-drive (start burning, stop, make slower or faster rotation, etc)?
How can I close the CD-ROM tray, using Java API or JNI?
Is it possible at all to interact with cd-drive (start burning, stop, make slower or faster rotation, etc)?
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().