aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Headless and java.awt.Color Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Headless and java.awt.Color" Watch "Headless and java.awt.Color" New topic
Author

Headless and java.awt.Color

Lautaro Brasseur
Greenhorn

Joined: Aug 06, 2005
Posts: 13
Hello, I have a problem with java.awt.Color class. I'm running Java on a Linux with Blackdown-1.4.2-03 JVM, without graphical environment (X).

When I try to load class java.awt.Color, it gives me a ClassNotFound exception. I tried setting the system propert java.awt.headless to true, but then it gives an error about libXp.so.6 not being found...

Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/lib/j2se/1.4/jre/lib/amd64/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1437)
at java.awt.Toolkit.<clinit>(Toolkit.java:1458)
at java.awt.Color.<clinit>(Color.java:250)
at neoris.Prueba.probar(Prueba.java:35)
at neoris.Prueba.main(Prueba.java:22)

I used headless parameter with some products such as JasperReports in past (over a distinct environment) and it worked well...

Somebody has a similar problem? Maybe java.awt.Color class doesn't supports headless parameter in Blackdown JVM?

Thanks

Lautaro


Lautaro Brasseur<br />SCJP 1.4 (95%) / SCBCD 1.3 (100%)
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8968
    
    9

Sounds to me like you have an install issue. usr/lib/j2se/1.4/jre/lib/amd64/libawt.so doesn't sound like a blackdown path to me, it sounds like a Sun JRE. Check your paths and Java configuration. I think your LIBPATH is pointing to the wrong JRE.


[How To Ask Questions On JavaRanch]
Lautaro Brasseur
Greenhorn

Joined: Aug 06, 2005
Posts: 13
The path is ok, I asked to system administrator.

I just checked java.awt.Color source code and at class static initialization code it calls java.awt.Toolkit.loadLibraries, regardless of headless system property.

I solved the problem installing the libraries... It seems that java.awt.Color requires them even in headless mode.

Thanks a lot

Lautaro
Pavan Gulhane
Greenhorn

Joined: Sep 18, 2006
Posts: 1
Hi Lautaro,
I am facing the similar problem with the jasper reports on Linux .
The famous: java.lang.UnsatisfiedLinkError
The Env. is : Linux RH on java 1.3.1 WAS 5
When you say that you have installed the libraries and it worked, can you please let me know the details.
I am desperately looking for the fix/solution.
Do let me know if you need some info.

Thanks in advance
Pavan Gulhane.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Headless and java.awt.Color