LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Setting environment variable java.awt.headless=true for an account (https://www.linuxquestions.org/questions/linux-newbie-8/setting-environment-variable-java-awt-headless%3Dtrue-for-an-account-4175497150/)

threezerous 03-05-2014 01:57 PM

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

colucix 03-05-2014 02:03 PM

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

joe_2000 03-05-2014 03:46 PM

Maybe this also helps

http://www.oracle.com/technetwork/ar...ss-136834.html

threezerous 03-05-2014 04:04 PM

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.

joe_2000 03-05-2014 04:06 PM

Quote:

Originally Posted by threezerous (Post 5129572)
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 :-)

threezerous 03-05-2014 04:33 PM

Than You. That got me beyond that error.


All times are GMT -5. The time now is 07:52 PM.