Hi: I am using the HTMLEditorKit cnd HTMLDocument classes to read in and parse HTML. I have it working just fine but would like to understand why the createDefaultDocument() method in the following code throws an InternalError exception when DISPLAY is not set to something reasonable.
When I set DISPLAY to something reasonable this works fine, but I would like to know what is causing createDefaultDocument() to do anything "graphical".
I can't tell you exactly (although if you really wanted to know, you could trace through with a debugger,) but ultimately, loading the various classes that make up Swing will eventually load the native libraries that are part of the AWT, and those will contact your X server, and if DISPLAY isn't set to something available (or the default :0.0 isn't available) then you'll have an error.
See here for a discussion of "headless" operation in JDK 1.4 and later. Basically, you may be able to avoid this issue by launching java with