Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6972569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:59:11+00:00 2026-05-27T16:59:11+00:00

I’m working on a application called LMCT(Let Me Copy That) and it is programed

  • 0

I’m working on a application called LMCT(Let Me Copy That) and it is programed in Java, I just need to know how to burn to a DVD/CD from java.

any example, API or link is welcome.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:59:12+00:00Added an answer on May 27, 2026 at 4:59 pm

    I’ve done this using COM4J and IMAPI (works on Windows only).

    This sample code burns an ISO file using the first CD recording device in the system:

    File isoFile = new File("myimage.iso");
    
    IDiscMaster2 dm = ClassFactory.createMsftDiscMaster2();
    int count = dm.count();
    
    //Pick the first recorder on the system
    String recorderUniqueId = null;
    for (int i = 0; i < count; i++)
    {
        String cur = dm.item(i);
        recorderUniqueId = cur;
    }
    
    IDiscRecorder2 recorder = ClassFactory.createMsftDiscRecorder2();
    recorder.initializeDiscRecorder(recorderUniqueId);
    System.out.println("Using recorder: " + recorder.vendorId() + " " + recorder.productId());
    
    IIsoImageManager imageManager = StreamClassFactory.createMsftIsoImageManager();
    imageManager.setPath(isoFile.getAbsolutePath());
    imageManager.validate();
    System.out.println("ISO Validation successful: " + isoFile.getAbsolutePath());
    
    IDiscFormat2DataExt discData = ClassFactoryExt.createMsftDiscFormat2Data();
    discData.recorder(recorder);
    discData.clientName(IsoMan.class.getSimpleName());
    int mediaStatus = discData.currentMediaStatusExt();
    System.out.println("Media status: " + mediaStatus);
    if ((mediaStatus & IMAPI_FORMAT2_DATA_MEDIA_STATE.IMAPI_FORMAT2_DATA_MEDIA_STATE_WRITE_PROTECTED.comEnumValue()) != 0)
        throw new RuntimeException("Media is write protected / not empty.");
    
    //Check if disc is empty
    int addr = discData.nextWritableAddress();
    if (addr != 0)
        throw new RuntimeException("Disc is not empty, not writing.");
    
    IStream isoStream = imageManager.stream();
    
    System.out.println("Writing CD");
    discData.write(isoStream);
    System.out.println("Finished writing");
    

    I had to supplement the COM4J generated classes a bit because the generator didn’t do a perfect job:

    /**
     * Defines methods to create COM objects
     */
    public abstract class ClassFactoryExt {
        private ClassFactoryExt() {} // instanciation is not allowed
    
        /**
         * Microsoft IMAPIv2 Data Writer
         */
        public static com.ms.imapi2.IDiscFormat2DataExt createMsftDiscFormat2Data() {
            return COM4J.createInstance( com.ms.imapi2.IDiscFormat2DataExt.class, "{2735412A-7F64-5B0F-8F00-5D77AFBE261E}" );
        }
    }
    
    /**
     * Data Writer
     */
    @IID("{27354153-9F64-5B0F-8F00-5D77AFBE261E}")
    public interface IDiscFormat2DataExt extends com.ms.imapi2.IDiscFormat2Data {
        /**
         * The state (usability) of the current media
         */
        @VTID(18)
        //com.ms.imapi2.IMAPI_FORMAT2_DATA_MEDIA_STATE currentMediaStatus();
        int currentMediaStatusExt();
    }
    
    /**
     * Defines methods to create COM objects
     */
    public abstract class StreamClassFactory {
        private StreamClassFactory() {} // instanciation is not allowed
    
    
        /**
         * Boot options
         */
        public static com.ms.imapi2.IBootOptions createBootOptions() {
            return COM4J.createInstance( com.ms.imapi2.IBootOptions.class, "{2C941FCE-975B-59BE-A960-9A2A262853A5}" );
        }
    
        /**
         * File system image
         */
        public static com.ms.imapi2.IFileSystemImage3 createMsftFileSystemImage() {
            return COM4J.createInstance( com.ms.imapi2.IFileSystemImage3.class, "{2C941FC5-975B-59BE-A960-9A2A262853A5}" );
        }
    
        /**
         * Microsoft IMAPIv2 Iso Image Manager
         */
        public static com.ms.imapi2.IIsoImageManager createMsftIsoImageManager() {
            return COM4J.createInstance( com.ms.imapi2.IIsoImageManager.class, "{CEEE3B62-8F56-4056-869B-EF16917E3EFC}" );
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I need to clean up various Word 'smart' characters in user input, including but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.