Executable banks are very slow

I have done several projects and packaged them into jar files, but I noticed that my jar files are much slower than in my IDE.

I use Eclipse to compile and run my programs. Everything works for me in Eclipse. When I pack my project as a running Jar and double-click it, everything still works. But when I have animation, the program slowly starts extreme . Instead of 30 frames per second in Eclipse, I now get about 2 frames per second. The animation is very laggy.

Interestingly, when I run the same Jar from the command line ( java -jar MyCode.jar ), the lag disappears and my program works fine.

I do not currently know what causes this problem. My computer is running Windows Vista. I am using the latest version of JRE and JDK. My program contains animation, nothing unusual.

Thanx

Solution: There were several different versions of Java on my computer, and the incorrect version was used.

+4
source share
3 answers

The version of java.exe that ships with Windows is very outdated. By changing the association of the .jar extension with a later JVM, you should see a significant improvement.

+4
source

You can also consider whether any running antivirus software affects performance. Some programs treat .jar files as .zip archives, which they are, and scan accordingly. Their integration with the shell may explain the difference between double-clicking and the command line.

+4
source

You may have associated a double click with some "bad" version of the JVM.

What I would do is use processxp from SysInternals to find out what your application interpreter is using. This is probably just a matter of changing it in the same way as the command line and eclipse.

Check this and see if it uses the same JVM (there is a command line with the column names in ProcessXP, compare this value)

Hope this helps.

+3
source

All Articles