Neil
Neil

Reputation: 6039

Distribute Java jar application in Optical Disk

I am trying to ship my Jar application using DVDs and need the user just to run an exe and launch the program. So I have written a batch file which runs the jar using the private JRE shipped in the same DVD.

Now when I run the batch file from the DVD it takes over one minute to launch the application because JRE is in the DVD as well.

When I copy the JRE in hard disk and use that in my batch file to lauch the program it runs fast. However I wouldn't the path where the user copies the JRE in his hard disk. How would I detect the same in my batch file ?

Upvotes: 1

Views: 160

Answers (2)

Tinman
Tinman

Reputation: 786

OK, I'd suggest updating your batch script to look for JAVA_HOME. If present and equal or newer to the version you are running, then use that JRE instead.

See the following blog for instructions on how to do this. http://www2.hawaii.edu/~sdunan/study_guides/ics211/WindowsCommandLineCompiling.html

Upvotes: 0

GreyBeardedGeek
GreyBeardedGeek

Reputation: 30088

I think that the best solution to your problem is to use a Java application installer, and to put the installer on the DVD. Some Java application installers include the ability to bundle a JRE, for instance Launch4J.

Upvotes: 1

Related Questions