LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-05-2014, 02:57 PM   #1
threezerous
Member
 
Registered: Jul 2009
Posts: 91

Rep: Reputation: 15
Question Setting environment variable java.awt.headless=true for an account


For one of my GUI installers, there is a requirement to add variable java.awt.headless=true to the environment system properties of the account I am running the installer as.

I take it to mean set environment variable in .bash_profile of the account as

export java.awt.headless = true.

However, when I su - <user> to the account I get a message

-bash: export: `java.awt.headless': not a valid identifier
-bash: export: `=': not a valid identifier

What am I missing? This is also probably the cause of the error below when I try to run the GUI installer

Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit
at java.awt.Component.<clinit>(Component.java:595)
at com.izforge.izpack.installer.GUIInstaller.showFatalError(Unknown Source)
at com.izforge.izpack.installer.GUIInstaller.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at com.izforge.izpack.installer.Installer.main(Unknown Source)

Any ideas/suggestions on what I could be missing?
I have confirmed xeyes works fine so X11 is set correctly.

Thanks
 
Old 03-05-2014, 03:03 PM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Variable names cannot contain dots in bash. Maybe you want to set it inside the java program. Here is a (maybe) relevant topic: http://stackoverflow.com/questions/2...ogrammatically
 
Old 03-05-2014, 04:46 PM   #3
joe_2000
Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 812

Rep: Reputation: 216Reputation: 216Reputation: 216
Maybe this also helps

http://www.oracle.com/technetwork/ar...ss-136834.html
 
Old 03-05-2014, 05:04 PM   #4
threezerous
Member
 
Registered: Jul 2009
Posts: 91

Original Poster
Rep: Reputation: 15
Thank you for the info regarding dots not being allowed. Did not know that. Is there any other way to set this variable at command line level? My installer asks me to run the installer as java -jar <name of jar> and I do not have the source where I can update the variable.
 
Old 03-05-2014, 05:06 PM   #5
joe_2000
Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 812

Rep: Reputation: 216Reputation: 216Reputation: 216
Quote:
Originally Posted by threezerous View Post
Thank you for the info regarding dots not being allowed. Did not know that. Is there any other way to set this variable at command line level? My installer asks me to run the installer as java -jar <name of jar> and I do not have the source where I can update the variable.
try
Code:
java -Djava.awt.headless=true -jar <name of jar>

EDIT:... which by the way was also mentioned in the link I posted in my previous answer :-)

Last edited by joe_2000; 03-05-2014 at 05:08 PM.
 
1 members found this post helpful.
Old 03-05-2014, 05:33 PM   #6
threezerous
Member
 
Registered: Jul 2009
Posts: 91

Original Poster
Rep: Reputation: 15
Than You. That got me beyond that error.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] cygwin issue - java.awt.HeadlessException:No X11 DISPLAY variable was set, but .... threezerous Linux - Newbie 2 10-06-2013 06:38 AM
Setting an environment variable... netpumber Linux - General 15 11-12-2010 08:52 AM
environment variable setting chii-chan Linux - General 5 01-23-2009 08:29 PM
java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit artemis8543 Linux - Newbie 4 05-16-2006 09:38 PM
Setting an environment variable kharris Linux - General 3 10-02-2003 05:38 PM


All times are GMT -5. The time now is 06:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration