[OpenJDK 2D-Dev] lcms native library

christof.helfrich at freenet.de christof.helfrich at freenet.de
Mon Apr 7 08:30:14 UTC 2008


Dimitri, my assumption was wrong that OpenJDK 6 doesn't include lcms. Thanks Phil, I have looked into the wrong sources.
Now I have compiled the relevant parts of OpenJDK 6 to get lcms running in my test environment (still Sun JDK 1.6.0, because a complete switch to OpenJDK 6 is currently not an option, maybe later).
Unfortunately the native library throws an Exception when loading GRAY.pf, here is the exception:

java.lang.IllegalArgumentException: Invalid profile data
	at sun.java2d.cmm.lcms.LCMS.loadProfile(Native Method)
	at java.awt.color.ICC_Profile.getInstance(ICC_Profile.java:778)
	at java.awt.color.ICC_Profile.getInstance(ICC_Profile.java:994)
	at java.awt.color.ICC_Profile.getInstance(ICC_Profile.java:959)
	at java.awt.color.ICC_Profile$2.run(ICC_Profile.java:910)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.color.ICC_Profile.getStandardProfile(ICC_Profile.java:905)
	at java.awt.color.ICC_Profile.getInstance(ICC_Profile.java:876)
	at java.awt.color.ColorSpace.getInstance(ColorSpace.java:333)
        ....

What I'm doing is:

  System.loadLibrary("lcms"); // lcms native library  with all references to Trace.c and Dispose.c removed
  System.setProperty("sun.java2d.cmm", "sun.java2d.cmm.lcms.LCMS");
  System.setProperty("java.iccprofile.path", "path where my pf files are located");
  // ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB); // ok
  ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_GRAY); // exception

I get the same error message with the GRAY.pf from original Sun JDK and also with the GRAY.pf included in OpenJDK6.
I can't imagine that a corrupt GRAY.pf would have been unnoticed. Any idea?

Christof












More information about the 2d-dev mailing list