Runnable jar runs too slow compared to eclipse project

人走茶凉 提交于 2019-12-04 09:34:08

Using the option "Extract required libraries into generated file" helped me a lot, it's faster now.

The option "Package required libraries into generated JAR" copy the libs you use as jar files into your own jar file and the JVM needs to open it (or even extract if it's compacted) when you run the application.

I found the problem I hope it will help someone else. First it is faster if you export a runnable jar file with option: "Extract required libraries into generated file" And second the biggest problem was that I was using input arguments like:

String inputArgument = args[0];

and then I was using the inputArguments somewhere after in code. So I erased this and I was using args[0] wherever I needed this input argument in the code. I am not sure if it is the best thing to do but it worked for me and it had a lot of difference in time.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!