Getting java.awt.HeadlessException on guiserver startup.

Started by mxvanzant, May 17, 2011, 07:40:48 PM

Previous topic - Next topic

mxvanzant

When running newlisp-edit:


mxvanzant@hj004:~/Downloads/newlisp-10.3.0$ newlisp-edit
newLISP-GS v.1.43 on Linux
Exception in thread "main" java.awt.HeadlessException
at sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:82)
at guiserver.<init>(guiserver.java:207)
at guiserver.main(guiserver.java:78)
Could not connect to guiserver.jar


When attempting to start the guiserver directly:


mxvanzant@hj004:/usr/share/newlisp$ java -jar guiserver.jar
newLISP-GS v.1.43 on Linux
Exception in thread "main" java.awt.HeadlessException
at sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:82)
at guiserver.<init>(guiserver.java:207)
at guiserver.main(guiserver.java:78)
mxvanzant@hj004:/usr/share/newlisp$


I'm running on Ubuntu 10.10 64 bit.

I downloaded the newlisp-10.3.0 source and ran:

  make -f makefile_linuxLP64_utf8

and then

  make check

and then

  sudo make install



newlisp runs okay (non-gui)

but newlisp-edit gives the above error.



Any ideas? -- Thanks! (Note: nevermind, I figured it out, see below:)



Java version:


mxvanzant@hj004:/usr/share/newlisp$ java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.7) (6b20-1.9.7-0ubuntu1)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)


I switched to sun's java:


mxvanzant@hj004:/usr/share/newlisp$ sudo update-alternatives --config java
[sudo] password for mxvanzant:
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                      Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode
  2            /usr/lib/jvm/java-6-sun/jre/bin/java       63        manual mode

Press enter to keep the current choice[*], or type selection number: 2


I no longer get the HeadlessException, but now I have a port conflict:


mxvanzant@hj004:/usr/share/newlisp$ java -jar guiserver.jar
newLISP-GS v.1.43 on Linux
 double buffering supported.
 listening on 64001
Exception in thread "main" java.net.BindException: Address already in use
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
at java.net.ServerSocket.bind(ServerSocket.java:328)
at java.net.ServerSocket.<init>(ServerSocket.java:194)
at java.net.ServerSocket.<init>(ServerSocket.java:106)
at guiserver.main(guiserver.java:90)
mxvanzant@hj004:/usr/share/newlisp$


But, that was running directly from the .jar file. I decided to try newlisp-edit



It works !!! :)