How To: Distribute Java Apps on Autorun CDs

You can distrubute your Java windows applications on MS-Windows-compatible CD, using the contents of the JRE folder in your JDK installation. Users of the CD do not need the JDK or the JRE on their system, because it's on the CD!

STEP 1: Jars
Put your .class files, and any supporting media files, into one or more jars. Copy the jar file(s) to the /jre/lib/ext folder of your JDK installation. (If your application uses any 3rd party jars, copy them, too).

STEP 2: Verification
Go to a MS-DOS prompt, and log into the /jre folder of your JDK installation. Verify that your application runs correctly by using the following command (substituting your application's startup class for yourPackage.yourClass):

C:\jdk1.3.1\jre\> bin\javaw yourPackage.yourClass

STEP 3: Autorun Files
Right-click here to download autorun.exe, and store it in the /jre folder of your JDK installation. Right-click here to download autorun.inf, and store it in the /jre folder of your JDK installation. Using Notepad, edit the autorun.inf file, replacing the yourPackage.yourClass text with your application's startup class -- the statement should be the same as the one you used in step 2 above.

STEP 4: Write The CD
Copy the contents of the /jre folder to a CD-R. Do not copy the /jre folder itself -- just its contents.

The CD should automatically start your application when inserted into a Windows-based computer. But be patient -- it may take a while before anything appears on the screen.