I am shipping private JRE along with jar program in the DVD. It takes about 3 minutes if I directly run the program from the DVD. Probably it takes time to load the JRE libraries to main memory as optical disks speed is slow. However when I close the program and re-launch , it gets launched instantaneously as if JRE is installed in the local computer (which is not). I think JRE stays in the memory even after I close the program.
3 minutes is a big waiting time for users, is there any way I can optimize the code (which is the only thing under my control) that it loads only few libraries to launch and load the the other necessary ones on demand. Now probably it is trying to load everything from DVD before showing the program window as suggested by
$java.exe -verbose -jar myProgram.jar
Is there any other solution to launch the program quickly even in the 1st time ? Currently the only workaround is to use the Launch4J .bmp splash screen buts that is very static.
Note: I know installing JRE in local machine will solve the problem but the program is not for technical users, my Launch4J does not find it if installed in custom directory. Also my DVD is copy protected so that the program can not be distributed.