Game is fast in eclipse yet slow on desktop

Ive been working on a little project recently and i compile the code very rarely as i just run it in eclipse to test if a feature is working. When i run the program in eclipse it runs fine however when i run it on the desktop the frame rate lag spikes every second or so. It’s amazingly odd. On the subject of this i also though i would mention that when i run program’s in eclipse all graphics work correctly however when on the desktop some graphics dont appear. It annoys the hell out of me :smiley:

Could be that the issues are related: can’t find resources because of incorrect project setup --> constant errors/stacktraces --> lag

How do you set up a project correctly and how come errors and stack traces dont show up in eclipse, or how do you know what the errors are related to

Make sure everything that is accessible in Eclipse is also accessible everywhere else.

From what i know they are, there are just two graphics that dont work yet there in the same location as everything else where there are other graphics that work, one other question when you compile a project which of the three settings do you select, i cant remember what they are i think its like, package required libraries, package all library’s and something else

The errors don’t show up in eclipse because the project setup is ok for eclipse due to classpath, etc. But when exported the environment changes, so it may not work. Just my hunch, as it happens a lot, and is quite an easy mistake to make IMO.

Run your program from the command line to see if there are any errors.


java -jar YourProgram.jar

Do i just put that command into windows command prompt

If you’re in Windows, then yes. You asking this kind of scares me, but it’s fine. I really do suggest getting comfortable with whatever shell you’re OS uses, it’s incredibly handy. Also, definitely learn more about the java commands.

What scares me is that he takes the 30 seconds to go and ask when it would take 5 to just go and try it.

Be proactive, be a problem solver.

I would but im on my iPhone…

Google? Common sense?

Anyway, let’s stop bashing the OP (after I just did :stuck_out_tongue: )

Last week I was working with sound in OpenAL, and I just used a FileInputStream to load the sound files.
And it worked fine in Eclipse but on desktop it didn’t…

Turned out I needed to use a BufferedInputStream instead to get it to work on desktop…

My point is that sometimes you run into some pretty weird bugs when going from Eclipse to runnable jar :stuck_out_tongue:

Common sense, are you an idiot? The chance that wen u go up to someone in the street and ask them how to run a java application through command line the chance of them getting it right is very very slim

“Java experience: 4 years”

Ugh, that Java experience counter is useless…

To be honest, I did encounter a similar problem with my 4k games. It can be related to the timer used. If you don’t use the nanosecond timer, the accuracy of the frame rate widely varies from computer to computer. What is more interesting is my games suffered a major slowdown after not running in Eclipse.

If it is the library access, and the fact that Eclipse can access a Java build that your PC can’t. That is possible. But, I can say for a fact that you aren’t imaging it. I’ve pretty much given my only solution I’ve come up with. For me, I’ve just gotten used to the fact that the Java implementations vary and code defensively in Eclipse from there.

Hopefully, that gives a bit more insight on the issue. At least I know it isn’t just me who realizes it. ;D

It’s as useful as the honesty of the person filling out the form. The risk of lying is that you look like an idiot :slight_smile:

Or worse, telling the truth, and saying something idiotic anyway ::slight_smile: I’m good at that.

Cas :slight_smile:

Yah you see it often, “Experience 4 years”.

Doesn’t know how to use or even create arrays.

@OP, reduce any I/O operations if you are relying on them. As in load everything in once, such as sounds and textures that are used.

@OP I meant common sense as in you know, you supposedly have 4 years programming knowledge. You should’ve figured out by now what the command line is. But whatever, I’m just an idiot for thinking that.