I’ve been dealing with Java for many years now – both as a programmer and as an end-user. Several times I’ve found compatibility issues with Win32 systems at graphics level – screen corruption, redraw problems, slow response, you name it. From my technical experience, I’ve known for a long time that this is mostly caused by the usage of DirectDraw inside the Java Virtual Machine. Typically, I would solve any problem with a specific application by providing this parameter directly to the JVM:
-Dsun.java2d.noddraw=true
This disables the use of DirectDraw for that application, and problem solved!
But ever since I got my new computer, I’ve had problems with practically ALL Java applications, including applets and such. At the first I didn’t care much, but lately it started to bother me a lot the way that applications were completely “freezing”. So, what I needed was a way to disable DirectDraw automatically for all applications automatically – a kind of “system wide” parameter. I found some people suggesting to disable video hardware acceleration completely on Windows. But, c’mon, I’m not going to lower the performance of my machine just because of a few measly applets!
Finally I found what I think it’s the perfect solution. I added a System Environment Variable named _JAVA_OPTIONS and provided the value -Dsun.java2d.noddraw=true. Every time the JVM starts, it will look for this environment variable and pass the provided parameters automatically. I can tell you that it works great!
Tags: Java, Win32
Categories: Tips 4 Geeks
No Responses to “Solving Java and DirectDraw problems”
Care to comment?