The framerate on my game drops from 16-19 to 10 when I run it from a jar by double-clicking. Running it from the same jar by command prompt or from the project itself in the IDE gives me the higher framerate.

I'm using LWJGL, but I've found posts about this problem both elsewhere and here by people not using OpenGL. No solutions that I noticed though.

It could be that Netbeans is taking up resources. I realize that is a very common trait on older computers and laptops. Netbeans isn't always a memory hog, but it totally depends on how it is configured.

It could be that Netbeans is taking up resources. I realize that is a very common trait on older computers and laptops. Netbeans isn't always a memory hog, but it totally depends on how it is configured.

"It could be that Netbeans is taking up resources."What? That doesnt make sense.Why blame the IDE? I use netbeans and that never happened.Plus, if it was netbeans, it would have to be running.

goblinJoel,if you are using netbeans make a profile analysis , post screenshots if you dont understand it.

Careful. I am pretty aware of the profiler of Netbeans and its capabilities. Post solutions to the problem, and don't dab too closely into the flames. Attack the argument, not the person. You'll be highly respected that way.

Careful. I am pretty aware of the profiler of Netbeans and its capabilities. Post solutions to the problem, and don't dab too closely into the flames. Attack the argument, not the person. You'll be highly respected that way.

? What!? I just said that its not the Ide's fault. Also, i meant for goblinJoel to check profiler, not you.And i did post the solutions.

If you have both 64 and 32 bit version of java installed, it's possible that the OS will use 32 bit jvm for running jar that are opened by double click, and 64 bit jvm for running everything else. The 64 bit jvm is considerably faster than the 32 bit jvm at the cost of longer start up time and more memory consumption.

If I search "java" in the start menu, it quickly comes up with Configure Java, About Java, and java.exe. If I open Configure Java, I'm seeing that I have Java 1.7.0_45 listed first in the User tab, with 1.6.0_31 second, and both are enabled. The System tab just has 1.7. All are located in Program Files (x86). So it looks like Windows is set up to use 32bit JREs.

If I instead open About Java, it tells me 1.7.0_45-b18. Presumably the same JRE that is listed first in Configure Java.

However, in control panel (Win7) -> Java, it lists only 1.6.0_26 in both User and System tabs, located in Program Files. So, that would indicate Windows is set up to use a 64bit Java 1.6 JRE.

The NetBeans project is set to use JDK 1.6 as the platform. Under Tools -> Java Platforms, I have JDK 1.6.0_26 as the default, followed by JDK 1.7.0. I did pick 1.6 intentionally, because I assumed developing for Java 6 would have a broader install base than Java 7, and it would let me get a better idea of how it would run on less up-to-date systems even if that wasn't true. I don't know if that's really the case.

I guess what's going on is that command prompt and NetBeans are set to use 64bit Java 6, while double-clicking jars is set to use 32bit Java 7. Does that look like the case to you guys?

...how do I straighten Windows out? It has two separate Java Control Panels, one accessible from Windows Control Panel (the 64bit Java 6), one accessible from the start menu (the 32bit Java 7 and Java 6).

And what should I expect users to have if it's this messy on mine?! Thanks for your help in at least steering me in the right direction so far.

Hm... well, I'm a little blurry on how forwards compatibility works in Java. If I wrote something in Java 7, and someone had Java 6, would it always work, sometimes work depending on the features I used, or never work? (Or maybe I could bypass the whole issue by distributing the right JRE with the game... I think I've heard you can do that.)

If there's no reason to use Java 6, then I might as well follow your advice.

As a side note, it's my personal irrational goal to make sure the game can run on my netbook, which, despite coming with Windows 7 Starter, for some reason only supports OpenGL 1.4. Even though it was made in 2009. So I guess I have a lot of sympathy for people on old machines that just want to play a game that doesn't really look like it should need a new machine.

If you wrote something in Java 7 it can be post-processed to make it work with Java 6 sometimes. However you are right in thinking that what you should be doing is distributing a JRE with the game itself; OpenJDK on MacOS (10.7+) and Linux, and the Oracle JRE for Windows.

I'll have to remember that about distributing the JRE with the game. I'm guessing a bit of searching will reveal some solutions or at least instructions for the best ways to do that.

Unfortunately, I'm pretty sure my netbook's video drivers are as up to date as I can get them. Intel 945GM does not appear to be the hottest thing around. Which brings up the related question of how to use OpenGL extensions with LWJGL, but I'll search around a bit more before starting a thread about that. (Unless you already have a link handy. )

Btw, I think it's cool that you frequent these forums. I loved Revenge of the Titans (despite not being able to tell what upgrades would do ahead of time), and I can't help but wonder how you find/steal time to answer newbie questions.

As a side note, it's my personal irrational goal to make sure the game can run on my netbook, which, despite coming with Windows 7 Starter, for some reason only supports OpenGL 1.4. Even though it was made in 2009.

It uses Microsoft GDI renderer, a kind of OpenGL emulation through Direct3D. You're lucky as lots of older laptops only get a driver supporting OpenGL 1.1, things could be worse. Maybe you need to use "allowSoftwareOpenGL=true", I'm not the best person to speak about LWJGL.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org