FAQ#14
How do I run a Java program?
Category: | Programs | Difficulty: | ![]() |
Assignee: | - | Due date: | |
Related issue: | - | Related Message: | - |
Related version: | - | Views: | 4556 |
Valid: | Valid |
Answer
Java expects a certain behaviour (reparenting of client windows) of a window manager which is not part of any standard, therefore some Java programs just show a white canvas.
If this happens just try to start your program like this:
1 AWT_TOOLKIT=MToolkit program
This changes the default tookit of Java to MToolkit, which is known to work with non-reparenting windows managers like subtle. Depending on your OpenJDK version and your architecture this may either lead to a segmentation fault or your OpenJDK just has no support for MToolkit. In this case check if your distribution has applied a patch for this issue which allows something like this to change the default behaviour:
1 _JAVA_AWT_WM_NONREPARENTING=1 program
In case both doesn't work there is a third option: Java seems to use an internally hardcoded list of window managers that are non-reparenting, the suckless guys made a tool (wmname) to change the name of the wm.
Since r2520 subtle can do that for you, just enable the :wmname option.
Generally this problem is really long lasting, see here:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511454
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508650
Note: Many problems only affect the JRE and can be avoided by using the OpenJDK.
Also available in: PDF