I am facing a strange problem. I have a project which is taking 3 to 4 minutes to execute while running through eclipse. But, the same project, taking 3 hours to complete the same task while extracting it as a runnable jar and running.
I have tried increasing heap size by running trough command line -Xmx=3600m and -Xms=1200m parameters.
Am I going in the right way. Is there any other ways to get down the execution time of runnable jar.
It might be worth comparing java client versions and ensuring that the machine running the jar is using the 64-bit architecture java client if available. Your eclipse runs using the JDK files (often 64-bit), but many systems only run 32-bit java clients for compatibility (specifically with browsers).
Is it possible that the jar file does not have all the libraries? Sometimes in my java programs, when an error is encountered, the process time increases significantly as the stack trace winds and unwinds. This is made worse if the error does not get handled properly.
Missing libraries could also cause this, as could running the jar in a different environment as the environment from whence you are running eclipse. Directory separators (if using files), or different ASCII characters getting brought in from APIs and such for different OS types.
Those are the causes I have noticed for unexpected java delays. Good luck!