Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Executable Jars running very slowly

I've done several projects and packaged them into jar files, but I've noticed that my jar files run much more slowly than in my IDE.

I use Eclipse to compile and run my programs. In Eclipse, I have everything working. When I package my project as a runnable Jar and execute it by double-clicking, everything still works. But when I have animation, the program runs extremely slowly. Instead of 30 frames per second in Eclipse, I now get about 2 frames per second. The animation is very laggy.

Interesting thing is, when I run the same Jar from the command prompt (java -jar MyCode.jar), the lag disappears and my program works as normal.

I currently have no idea what's causing this problem. My computer is running Windows Vista. I'm using the latest version of JRE and JDK. My program contains an animation, nothing fancy.

Thanx

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

like image 487
Bai Li Avatar asked Oct 19 '25 01:10

Bai Li


1 Answers

The version of java.exe that comes with Windows is very out of date. By changing the association of the .jar extension to the more recent JVM you should see much improvement.

like image 161
Chris Nava Avatar answered Oct 21 '25 16:10

Chris Nava



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!