We don’t directly support the Lejos software for this product; that link though should take you to the Lejos page; they’re great guys and should be able to help you get going with the dCompass and Java.
If that doesn’t work, there are a lot of examples in C, both for RobotC and for Bricxx we can try to help with.
In the first link there’s this example: Lejos Example (web) leJOS with the dCompass. Thank you kirkpthompson!. But as I’ve said, the link is broken.
The second link, actually it’s not an example, it is the driver, which I’m not getting correct values. By the way, I’m using NXT and lejos 0.9.1. Also, i’m trying to contact Aswin, maybe he could give us a hand here.