Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.awt.headless - based on what is this System property set?

Graham Griffiths
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm running some tests, which include java GUIs, on a Linux compute farm.

If the System property 'java.awt.headless' is set to true, then my tests fail with a HeadlessException - which is fair enough, because they genuinely display some GUI elements.

Now, whether 'java.awt.headless' is set to true or not changes depending on how I submit my job to the compute farm. I guess that the details of my compute farm are off-topic and not that interesting for anyone else on here. But what I would like to know is how, in general, does the JVM decide how to set the property 'java.awt.headless'? (on CentOS 4, if that makes a difference...)

Does it check the DISPLAY environment variable? Does it check to see whether it can connect to an X server? Or am I missing the point and it is just up to the user to set this property when creating/setting up the JVM?

Thanks for your help.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic