Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 May 2006 10:35:35 -0300
From:      Fernan Aguero <fernan@iib.unsam.edu.ar>
To:        Scott Mitchell <scott+lists.freebsd@fishballoon.org>
Cc:        freebsd-java@freebsd.org
Subject:   Re: java without X11?
Message-ID:  <20060505133535.GB12509@iib.unsam.edu.ar>
In-Reply-To: <20060504214118.GA1072@tuatara.fishballoon.org>
References:  <20060504121812.GA94022@iib.unsam.edu.ar> <20060504123935.GB94022@iib.unsam.edu.ar> <20060504214118.GA1072@tuatara.fishballoon.org>

next in thread | previous in thread | raw e-mail | index | archive | help
+----[ Scott Mitchell <scott+lists.freebsd@fishballoon.org> (04.May.2006 18:45):
|
| On Thu, May 04, 2006 at 09:39:35AM -0300, Fernan Aguero wrote:
| > +----[ To freebsd-java@freebsd.org <fernan@iib.unsam.edu.ar> (04.May.2006 09:18):
| > |
| > | Hi!
| > | 
| > | I was setting up a headless (no X11, no GUI) box and had to
| > | install java (required by apache-ant and by a java code that
| > | interacts with an underlying postgresql database).
| > | 
| > | I want this box to run only the base system (cut down to
| > | only essential daemons/processes) and one application
| > | (postgresql + associated perl/java layers).
| > 
| > [ snipped ]
| >  
| > | I know that a lot of java apps depend on GUI functionality
| > | provided by the language, but is this java+X11 a thing that
| > | cannot be separated? (i.e.  X11 is rooted too deep into
| > | java) or maybe it could be separated and we could have an
| > | optional WITHOUT_X11 in the various jdk ports?
| 
| The java binary in diablo-1.5.0_06 doesn't have a load-time dependency on
| libX11.so or any other X11 libraries, nor libawt.so - I guess the JVM will
| dlopen() libawt.so if it needs to do any graphical stuff.  As proof of
| concept a simple "Hello, World" Java program compiles and runs just fine on
| a machine with no X11 libraries installed.  I expect any program that
| didn't use AWT/Swing would work just as well.

Great, that was what I was about to do once I could get
hands on this box.

So, this means that I could safely ignore the warnings about missing
dependencies (upon package installation)?

| Interestingly libawt.so doesn't have any direct X11 dependencies either,
| rather it depends on libmawt.so, of which several different versions exist,
| in the jre/lib/i386/{xawt,motif21,headless} directories.  The xawt and
| motif21 versions depend on various X11 libraries, but the headless version
| does not.  It looks like setting the java.awt.headless property to true or
| just having no $DISPLAY will cause the headless libraries to be used.  You
| should be able to use AWT/Swing classes in any way that doesn't require
| access to a real display - so loading any manipulating images should work,
| but trying to say open a window will throw a HeadlessException.
| 
| Cheers,
| 
| 	Scott
|
+----]

OK, good to know.

thanks for your reply,

Fernan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060505133535.GB12509>