Java Runtime Problem

Gamingphreek

Lifer
Mar 31, 2003
11,679
0
81
For a group project in Java we are writing a Mario game called Colin.

Every machine I have run it on it works fine - except one. When I start running the code, it isn't running quickly. We have a GUI environment using JFrame, JPanel, etc...

We used listeners to move the block that, for right now, represents Mario.

I'm on my Laptop at home for Thanksgiving break running Ubuntu 8.10 (64bit) with Sun Java 6 (I got rid of OpenJDK).

Initially, the arrow keys and the space bar did not move it left and right and jumped when I pressed. I had to hold the key down and eventually it would start moving and would to a point wouldn't stop. It is like the Interrupt request doesn't make it through and it just starts logging it as one big keystroke that runs all at once afterwards.

I reinstalled and it ran fine.

Now, that I am home for Thanksgiving, it will not run properly again. It does the same thing it did previously...

Can anyone help me figure out what is going wrong. The code runs every where except this computer so it isn't a problem with our code.

I can provide the java project zip via E-Mail if you have any doubts or need any reference. (I caution, that it is incomplete and doesn't look very good yet)

-Kevin
 

The J

Senior member
Aug 30, 2004
755
0
76
Try opening up a terminal and using "update-alternatives" to make sure that the Sun Java is really the one being used. You can pass the option "--config java" to do this, I think. If that doesn't work, then try "update-alternatives --config all" and just go through them one-by-one. Run this as root.

If you are using Eclipse, there might still be the issue where it always uses GCJ. I don't know if this is still an issue since it's been so long since I've had to set it up, but might as well try it. Edit the file "/etc/eclipse/java_home" and move the directory for the Sun JDK to the top (you should see a bunch of entries). This might only apply to the IDE itself and not applications it launches, I don't actually remember.
 

clamum

Lifer
Feb 13, 2003
26,256
406
126
I can test out your project on my system if you'd like, PM me if ya want.
 

Gamingphreek

Lifer
Mar 31, 2003
11,679
0
81
Originally posted by: The J
Try opening up a terminal and using "update-alternatives" to make sure that the Sun Java is really the one being used. You can pass the option "--config java" to do this, I think. If that doesn't work, then try "update-alternatives --config all" and just go through them one-by-one. Run this as root.

If you are using Eclipse, there might still be the issue where it always uses GCJ. I don't know if this is still an issue since it's been so long since I've had to set it up, but might as well try it. Edit the file "/etc/eclipse/java_home" and move the directory for the Sun JDK to the top (you should see a bunch of entries). This might only apply to the IDE itself and not applications it launches, I don't actually remember.

I ran the first one earlier to make sure. I was indeed using the Sun-Java6-JDK though. This time I ran the --config all command you recommended and it couldn't find anything else to update.

I checked the project preferences in Eclipse and the build path is definitely going through only the sun-java libraries.

PM sent clamum!

Thanks,
-Kevin
 

Gamingphreek

Lifer
Mar 31, 2003
11,679
0
81
Originally posted by: IHateMyJob2004
So, this is all in Swing?

You said:
"I reinstalled and it ran fine. "

Reinstalled java6?

This is all in the javax.swing libraries.

By reinstalled, I mean I formatted and reinstalled Ubuntu and it ran fine.

-Kevin