Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

awt on unix

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See if this thread helps you.
 
sridhar anna
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am working on Solaris OS.

Thanks.
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you.
 
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic