Skip to main content

Still problems with OpenJDK...

Posted by fabriziogiudici on August 4, 2008 at 5:35 PM EDT
After fixing my trivial but severe error described in my previous post, other problems occurred with OpenJDK and blueMarine.

One turned out to be a third party library (svgSalamander) using some com.sun.* classes - this has been fixed by replacing it with another library for the same functions (Batik). For the record, these projects implement SVG rendering that I use for some icons of blueMarine (in the long run, all icons of blueMarine should become .svg). This of course isn't absolutely something to blame OpenJDK for, but you should run a check on your projects to be sure that you don't have similar issues (you might be too optimistic because you know that *your* code doesn't have bad dependencies, but what about the third parties' libraries you're using?).

Too bad that Batik seems to have problems with OpenJDK - and this seems to be harder: a method fails because the runtime seems to be unable to find an internal color profile LINEAR_RGB.
java.lang.IllegalArgumentException: Can't load standard profile: LINEAR_RGB.pf<br />
The same code works fine with Sun's JDK, and I even found an open issue about it - that should be closed since May (!). Too bad that it hasn't been updated for months and seems to be expiring today. On the other hand there is a similar issue closed in May, but it's probably only similar - in any case I think I'll file another report.

While I could unhappily work around that by manually replacing the offending icons with their bitmap counterpart, the same issue triggers when trying to manipulate some kind of photos - basically, "camera raw" formats. This isn't acceptable for blueMarine and, if I don't find a workaround, I will have to postpone the OpenJDK switch.

Since OpenJDK passed the Test Compatibility Kit (TCK), this means that some parts of imaging elaboration are not covered by it - and I'm really puzzled about that (it's to be said that most people won't use a LINEAR_RGB color profile - most of media comes with the sRGB profile). In any case, there's a blueMarine snapshot that at the moment at least starts with OpenJDK - this means that it should run on Fedora and other Linuxes without problems.

Another minor, but important, problem is that applications on OpenJDK seem to use by default a serif font - but this is something I should be able to fix by myself. In the next days I will also run some benchmark to see whether there are mayor differences in the graphics pipeline.

Technorati Tags: ,

Comments

It is possible, but would not make much sense for the distributions - if they can't build software from source, they can't ship it as a core part with Linux.

If they do build it from source, due to the fact that distributions don't release on the same schedule (there is no 'Next version of Linux' download day ;), they end up with different versions of dependencies used to build the software (C++ compiler, GUI libraries, etc.), and accordingly with different binaries. (If you are a Java developer, congrats on staying in a sane place, if you are a C/C++ developer, you'll know exactly what I mean ;)

That's why we have a the OpenJDK Community TCK License Agreement, and encourage distributions to sign up and work on passing the test suite. Currently, only the Fedora 9 build of OpenJDK6 on x86 and amd64 has passed the JCK, but I expect more distributions to release JCK-passing builds of OpenJDK6 in their next release cycle (~October/November).

I understand and I agree that the best thing is to work with distributions. I'll submit my application to distributions as soon as I get out of the beta phase. Nevertheless, I think this is quite annoying, considering the number of distributions out there, and it's a step backward when compared to the current Sun JDK. Isn't it possible to have the _same_ OpenJDK build to be available on all the distributions at the same time?

Even when all the implementations you are getting through distributions are certified, you would not be entirely safe: Passing the TCK does not imply that two different passing builds will have the same set of bugs.

The best way top support Linux users is to work together with distributions to package your software in the distribution - that way you can set the dependencies as necessary to run your software well, and have a good idea what environment they are using your software in.

Thanks. Actually, while I've not been able to download and install Fedora, a couple of guys at JUG Genova and JUG Milano did the test on Fedora, and it worked fine. The morale of all this his history is that, as you said, OpenJDK build X on a certain distro can pass the TCK, while the same OpenJDK build X not on other distos - this wasn't clear for me and I bet it isn't for most people :-) Probably you should find a way to differentiate the package name or a mess will arise - e.g. I can put on blueMarine a dependency on openjdk-6, it would work on Fedora and it wouldn't on Ubuntu - a source of headaches! If the package is named openjdk-6-tckwhatever_patch and that name guarantees that the package has passed the TCK, we would safe. If on a certain distro there is not yet that package, things will fail at installation and the user will be just aware that there's a missing thing on the distro, and won't blame neither Java neither the application developer for the problem.

It's the Fedora 9 build of OpenJDK on x86 and x86_64 that passed the TCK, not any build of OpenJDK in general - i.e. if you you want to try it out with a TCK-passing build, please try it on Fedora 9.

There is a lot of work going into making OpenJDK work really well in Ubuntu too in the current development series, Intrepid, and there has been a lot of work going into an update for Hardy, which in the hardy-proposed repository. It's not certified yet as passing the TCK, though (and in general TCK testing tends to uncover issues no one else has bumped into before) - but it should share most of the patches with the latest updates in Fedora and other distributions. If you want the latest bleeding edge, though, go for Intrepid (in a chroot ;)

In general, the best place to ask for advice wrt to a specific distribution is using its own channels (Launchpad/Bugzilla, mailing lists, IRC), as not necessarily everyone can follow everything that's going on with other distributions alongside their own, so the quality of advice can vary quite a bit. If you know how to use IRC, #openjdk is a good place to start, that's where all the distribution packagers are on.

An important follow-up: actually I've tested OpenJDK on Ubuntu. Mark Wielaard told me (http://thread.gmane.org/gmane.linux.redhat.fedora.java/2657) that he thinks that the Ubuntu .deb package could be an old one, in spite of having the same name as the Fedora .rpm package. I'll try to investigate tomorrow, time allowing.