• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

awt on unix

 
sridhar anna
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See if this thread helps you.
 
sridhar anna
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sridhar anna
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working on Solaris OS.

Thanks.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic