User e4183f4538
01-10-2011 04:55:29
Hi!
I just installed JChemWebServices 5.6, and upon logging in, would get an error message:
Could not initialize class sun.awt.X11.XToolkit
Google-fu informed me that a way to fix this was to simply turn on the headless java awt class. Not knowing any better (as my corresponding Java-fu is weak), I went through catalina.sh and put -Djava.awt.headless=true in each apparent Java launch section (where $1 = -security, else, $1=start, etc). This seems to have done the trick.
I'm posting for a few reasons:
1. Where should this command be located, as peppering it throughout catalina.sh seems excessive.
2. This seems to be an odd problem (according to the forums at least). Is there something missing from my system or my Java installation that would cause this?
3. In case anyeone else runs into this problem - here's a kludge.
Thanks!
Erin
User c1ce6b3d19
12-10-2011 10:29:57
Erin,
Nice job finding and applying a fix. Don't underestimate your java-fu!
I'm not sure where exactly is the best place for the -D command inside of catalina.sh, but if it bothers you, you can always start removing them until it stops working and then it should be apparent which is minimally needed.
I'm believe you are running the sun box straight through the command
line without an X Gui (or might be missing some GUI classes).
Thanks for helping out your fellow ChemAxon cheminfomaniacs!
Jon
User c1ce6b3d19
12-10-2011 10:38:32
Erin,
I forgot to mention that you should be able to set the environment variable (JAVA_OPTS) that is used by catalina.sh if you don't want to insert it directly into catalina.sh.
For example, editing the java opts line in <JChem_Web_Services_dir>/bin/startup.sh. The second option is setting the max memory and can also be set appropriately for your system needs.
JAVA_OPTS='-Djava.awt.headless=true -Xmx256M'
Jon
User e4183f4538
14-10-2011 01:14:52
Jon,
Great! Thanks for the info and the JAVA_OPTS environment setting - that's much easier than modifying catalina.sh :)
Cheers!
Erin