Empty Windows in Swing Applications on Ubuntu 7.10

Using Java applications on Ubuntu 7.10 (gutsy) sometimes show empty windows. I’ve encountered this mainly with LDAP Browser/Editor and IDEA 7.0. It does not occur too often and mainly with small dialog windows. I guess Java 6 has some problems with Compiz which is enabled by default since gutsy.

The solution is to upgrade to Java 7 which is currently available as an early access version from the JDK 7 project at Sun.

This fixed my problems with LDAP Browser/Editor but IDEA complained with a “Java Version Mismatch” error. IDEA 7.0 officially requires Java 5 or Java 6, but also works with the EA of JDK 7. You can disable the check for the correct Java version by adding the following line to idea.vmoptions:

-Didea.no.jdk.check=true

Update

As eivindw wrote in the comments you may also be able to make IDEA work with Java 6 by setting the following environment variable:

export AWT_TOOLKIT="MToolkit"

MToolkit switches to the Motif implementation of AWT which was removed for Java 7. On my 64-bit version of Gutsy using MToolkit with Java 6 resulted in a core dump.

Update

Related posts:

  1. Ubuntu 7.10 on the IBM Thinkpad T43p
  2. Using OpenOffice.org from Java Applications
  3. Using Maven with IntelliJ IDEA 7.0

15 thoughts on “Empty Windows in Swing Applications on Ubuntu 7.10

  1. is this working reliably for you?

    I find that the popup dialogue boxes have gone from being always blank, to intermittently working.

    I’m on 7.10 with the extra eye candy and intellij 7.01

  2. hooray. fixed.  Set the new JDK value in the /etc/environment when I had the old one set in /etc/profile. doh.

    Thanks, nice to finally have idea behaving politely in ubuntu with all the bells and whistles :) . Well for now..

  3. Do you think Intellij version 6.x would work ok with Java 7?  I don’t want to upgrade to Intellij 7.x and have my 6.x Intellij license expire.  Right now about half the popups come up blank. 

  4. Thanks, this finally provided the solution that i was looking for, since the JDK 7 dramatically reduced Intellij’s performance…

  5. I have same problems with Swing and Eclipse. The most windows in a J2SE application are empty. I found this happens only if I had activated the "Advanced Effects" on screen appearance menu.

  6. <pre class=”codeSample”>MToolkit solution would not work on 64-bit Ubuntu.

    As previous poster say, you can get Java 7 (beta).

    If you do use it, you need to turn-off JDK version check.

    You can do it by adding the following line to ‘
    idea.vmoptions’ file

    -Didea.no.jdk.check=true

    Cannot speak of performance hit – not much experience.

    Also, I tested openjdk-jdk and it looks like it works. So you may want to try that option.

  7. Okay

    I’ve been using with both openjdk and java 7 – both have serious issues.  I get ‘PermGen’ max error and sometimes it freezes up.  Very annoying….

    Maybe I move to Eclipse…

  8. Did you try using:
    export AWT_TOOLKIT=MToolkit
    ?

    This solved the issue for me without the need for a JDK upgrade

  9. The export AWT_TOOLKIT=MToolkit  trick also worked for me for some other java applets.
    Thanks for the tip.

  10. What does that mean?

    Im using Eclipse on Ubuntu. (Im a newbie)! All my project that use swing / awt, does not work. Just show a blank application? Anybody could tell me how to fix this?