next up previous Link to 'computer' page
Next: LYX Up: Software Previous: Firefox

Java

You can choose between different version of Java with `(sudo) update-alternatives -config java'.

The default `gcj' Java is missing several components. Look for packages starting with `gcj6' or `gcj7', some people have success after installing the development packages. Anyway, after installing Sun Java (1.5) and Blackdown Java (1.4) I completely removed gcj Java. Note that SunJava is not `free', and so is not provided on the Xubuntu install CD.

Java in many Debian distributions is unable to cope with certain fonts. The following error can be seen in programs like `BibleDesktop' when run with Blackdown Java 1.4. `BibleDesktop' starts, but fails when the menu item `Tools -- Options' is selected...

An unexpected exception has been detected in native code outside the VM.

Unexpected Signal : 11 occurred at PC=0xAACBC56F

Function=(null)

Library=/usr/lib/j2se/1.4/jre/lib/i386/libfontmanager.so

There seems to be a problems with libfontmanager.so. Sun Java 1.5 also crashes at exactly the same place of the program, but without the above error message. Andy DePue describes this problem on the IntelliJ Technology Network forums. He provides a program, based on a program written by Serge Baranov,which I reproduce below...

import java.awt.Font;

import java.awt.GraphicsEnvironment;

import java.awt.BorderLayout;

 

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.SwingUtilities;

 

public class FontTest {

  public static void main(String[] args) {

    final JFrame frame = new JFrame(Font test window);

    frame.setSize(800, 600);

    frame.getContentPane().setLayout(new BorderLayout());

    final JLabel label = new JLabel(The quick brown fox jumped over the lazy dog's back! +

                                    ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +

                                    @#$%^&*()_+-=,./<>?'\;:[{]}\\|`~);

    label.setFont(label.getFont().deriveFont(16.0f));

    frame.getContentPane().add(label, BorderLayout.CENTER);

    frame.pack();

    frame.setVisible(true);

    try {

        final Font[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();

        for (int i = 0; i < fonts.length; i++) {

          final int idx = i;

          SwingUtilities.invokeAndWait(new Runnable() {

            public void run() {

              final Font font = fonts[idx];

              final String name = font.getName();

    

              System.out.println(Checking Font:  + name);

    

              final boolean t1 = testChars(font, 'a', 'z');

              final boolean t2 = testChars(font, 'A', 'Z');

              final boolean t3 = testChars(font, '0', '9');

              System.out.println(Executing canDisplayUpTo...);

              final boolean t4 = font.canDisplayUpTo(The quick brown fox jumped over the lazy dog's back!@#$%^&*()_+-=,./<>?'\;:[{]}\\|`~) == -1;

              System.out.println(Executing printTest...);

              printTest(frame, label, font);

    

              if (t1 && t2 && t3 && t4) {

                System.out.println( OK.);

              } else {

                System.out.println();

              }

            }

          });

        }

        System.out.println(Finished);

        System.exit(0);

    } catch(Exception e) {

      throw new RuntimeException(e);

    }

  }

 

  private static boolean testChars(final Font font, final int start, final int end)

  {

    System.out.println(testChars(' + (char)start + ', ' + (char)end + '));

    boolean ret = true;

 

    for(int i = start;i <= end;i++) {

      if(!font.canDisplay((char)i)) {

        ret = false;

      }

    }

 

    return ret;

  }

 

  private static void printTest(final JFrame frame, final JLabel label, final Font font)

  {

    System.out.println(Entering printTest.);

    final Font derived = font.deriveFont(16.0f);

    System.out.println(Derived font);

    label.setFont(derived);

    System.out.println(Set font);

    frame.repaint();

    System.out.println(Repainted and leaving printTest.);

  }

}

Save this program as something like FontTest.java. Then compile this program with `javac FontTest.java', and then run the program with `java FontTest'. The program will crash with every font that Java cannot handle, so look for the last font mentioned before the program crashes. Remove the offending font, then try the program again. Unfortunately, sometimes the name of the font, e.g. `ted by sachin', gives me no indication which debian package has the offending font.

Fonts I removed...


next up previous Link to 'computer' page
Next: LYX Up: Software Previous: Firefox
David Fong 2011-01-25