Jump to content
  • Advertisement
Sign in to follow this  

Java: Closing a JFrame causes unexpected error.

This topic is 2442 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

PC Type: Desktop Computer.
OS: Windows 7 64-bit
IDE: Eclipse Indigo IDE for Java Developers

I have this annoying problem that sort of involves closing the Java application. Whenever I run a Java program, be it Minecraft, a Java program I'm developing, or applets running in the web browser, nothing is wrong. Once I close them, Windows 7 would pop up a message after a moment with the message:

Capture3.png

I do know this is not Eclipse's problem, rather, it's Java's problem that I don't even know what it is. I wanted to get rid of this problem of Java crashing.

Here's a small Java program I have created in a short amount of time. Short and simple:

Capture1.png

When the program is running, it looks like this:

Capture2.png

When I pressed the X button, it gives the error message shown at the top. Always. I nailed down to JFrame easily. I haven't done more extensive testings, and will do if you know some.

I checked the Environment Variables for the PATH settings to see if it's correctly linked to Java, and here's what was shown:

Capture4.png

I didn't see anything wrong, so I don't know what else to look for. If anyone can help me, please let me know. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Did it ever work - or do you think something like Java update broke it? Have you tried installing the latest JDK/JRE?

What does it say if try the "Debug" option?

Share this post


Link to post
Share on other sites

Did it ever work - or do you think something like Java update broke it? Have you tried installing the latest JDK/JRE?

What does it say if try the "Debug" option?


It's a JVM crash, there's nothing meaningful left to debug.


Almost certainly driver bug, probably with graphics. But could be anything else really.

For third-party applications it might be problematic, but for your own, pass "-Dsun.java2d.noddraw=true" to JVM. So: "java -cp myapp.jar -Dsun.java2d.noddraw=true com.test.MainClass".

Eclipse has a field under run configuration where you can add that.

Share this post


Link to post
Share on other sites
The debug option might show the chain of DLLs it crashed in, which could help diagnose it as a graphics problem, like you currently speculate. I'm not suggesting the OP actively try to debug the JVM.

Share this post


Link to post
Share on other sites

Almost certainly driver bug, probably with graphics. But could be anything else really.

For third-party applications it might be problematic, but for your own, pass "-Dsun.java2d.noddraw=true" to JVM. So: "java -cp myapp.jar -Dsun.java2d.noddraw=true com.test.MainClass".

Eclipse has a field under run configuration where you can add that.


Oh my God! This seems to fix my problem. Nothing is popping up or anything.

Is it because Java2D is partially supported by Nvidia? I'm using GeForce GTS 250.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!