*
The moose likes Linux / UNIX and the fly likes awt on unix Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "awt on unix" Watch "awt on unix" New topic
Author

awt on unix

sridhar anna
Greenhorn

Joined: May 19, 2005
Posts: 23
Hi,

In the unix environment I am developing an application using JBoss server. I am using HTMLEditorKit, BufferedImage and JPEGImageEncoder. Instead of an image, I am getting a blank jpeg in the output. I tried to set the System property headless=true in the java file. It did not work.

Will it work if the system property is set in the JBoss properties file? Is this related to XServer?

Any info on how to get this working would be greatly appreciated.

Thanks in advance,
sridhara.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

See if this thread helps you.
sridhar anna
Greenhorn

Joined: May 19, 2005
Posts: 23
Thank you for the quick reply. I have tried the headless option. I did not get any exceptions, but I did not get the image, just a blank jpeg. I would like to try Xvfb. Can you please let me know how to use Xfvb. I am using java 1.4.1, jboss 4.0 and UNIX.

Thanks,
sridhara.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I referred you to the other link because you said you used "headless=true" but didn't specify how. The thread describes how to use "java.awt.headless=true"

I haven't used Xvfb so there is not much I can say about that. I have used another library which provides AWT support without requiring native graphics drivers, but I can't remember the name of it.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Xvfb is easy to use. You just run it like "Xvfb :2 &", and that gives you an X display named ":2". So you can then just run "DISPLAY=:2 jboss.sh" or whatever you need. Works very well and very easy to do.


[Jess in Action][AskingGoodQuestions]
sridhar anna
Greenhorn

Joined: May 19, 2005
Posts: 23
Where do I start? Do I have to download anything to run Xvfb or can I just type it up in bash? I am relatively new to X concepts. Is there any better way to work with graphics on UNIX. Please let me know.

Thanks a lot,
sridhara.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

You may need to install it, or it may already be installed. If you tell me what kind of UNIX you're using (i.e., Red Hat Linux, Solaris, HPUX) I can try to tell you what to do in more detail.
sridhar anna
Greenhorn

Joined: May 19, 2005
Posts: 23
Hi,

I am working on Solaris OS.

Thanks.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Well, it should be in /usr/X11R6/bin . If it's not, then you'll have to ask your sysadmin to install it, because the way it's written, the location is hard-coded into the binary itself. To compile it from scratch, you need the full X11R6 sources, and that's not something to be undertaken lightly!
sridhar anna
Greenhorn

Joined: May 19, 2005
Posts: 23
Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: awt on unix
 
Similar Threads
Namespace dump in JBoss
Java mail failing on some machine
saaj implemetation in JBoss 4.2.3 still broke for jax-rpc services?
Java property files best practices
Ant Modifying Property file