Search code examples
javadvd

Demo Java application runnable from a DVD


I wish to give some demo copies of a Java application on a DVD to a client. Does it make sense to have a preinstalled JRE and Java application on a DVD so that they can just click and run it?

Also, if anyone has done this what are your views on this?


Solution

  • Indeed you can simply put a JRE into a directory of the DVD.

    Then you start the application with a .bat file that runs a command such as :

    jre\bin\java.exe -jar Main.jar 
    

    (If your jar and the jre folder are in the same directory)

    Be careful about one thing : you can't know in advance what the DVD's drive letter will be, so in your .bat file you must give relative paths to the JRE and to your jar (or starting class).