可执行罐子运行得非常慢 [英] Executable Jars running very slowly

查看:139
本文介绍了可执行罐子运行得非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经完成了几个项目并将它们打包成jar文件,但我注意到我的jar文件比我的IDE运行得慢得多。

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使用Eclipse编译和运行我的程序。在Eclipse中,我完成了一切。当我将项目打包为可运行的Jar并通过双击执行它时,一切仍然有效。但是当我有动画时,程序会慢慢地运行。而不是Eclipse中的每秒30帧,我现在每秒大约2帧。动画非常滞后。

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.

有趣的是,当我从命令提示符运行相同的Jar时( java -jar MyCode.jar ),滞后消失,我的程序正常工作。

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.

我目前不知道是什么导致了这个问题。我的电脑正在运行Windows Vista。我正在使用最新版本的JRE和JDK。我的节目包含动画,没什么特别的。

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

解决方案:
我的计算机上有几个不同版本的Java,并且使用了不正确的版本。

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

推荐答案

java的版本。 Windows附带的exe已经过时了。
通过将.jar扩展名的关联更改为更新的JVM,您应该会看到很多改进。

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.

这篇关于可执行罐子运行得非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆