My program works perfectly fine when I run from eclipse but I package it to an executable jar and run it from command line, it runs much slower (almost five times slower). I am even setting the -vmargs while executing the jar java -Xms40m -Xmx512m -jar jarFile.jar I do not have any older version of java on my machine. I am not able to understand what I am missing over here. How can eclipse run the same program faster while using the same version of java and same vm arguments. Any help would be appreciated.
Thanks, karthik
We had a similar issue but the problem was that while exporting Java code as a runnable jar file from eclipse, we were choosing an option "Package Required Libraries into generated jar". This was putting all of the referenced libraries as jar files within the runnable jar, which probably was being unpackaged during every run. Instead of that we used "Extract required libraries into generated jar" option while creating the runnable jar file and the speed of the execution of jar shot up - almost same as it was while running the code within eclipse.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With