tags:

views:

44

answers:

1

When I set LD_DEBUG=files and run my Java program, I found many errors like this:

/linux/depot/java-1.6.0_16_32/jre/lib/i386/libjava.so: error: symbol lookup error: undefined symbol: Java_sun_java2d_loops_MaskBlit_MaskBlit (fatal)  

This info is horrifying, but obviously my program runs OK. Can anyone tell me why this happens?

A: 

It's not horrifying; it's what happens when you build code to run on a lot of different platforms. It's just the jvm looking for optional symbols. In this case, something to do with 2D and alpha compositing. There is an alternate code path that is taken if the symbol is not found at runtime. You can think of it as a sort of reflection for libraries.

The jvm code goes something like this:

TYPE fptr = CAST_TO_FN_PTR(TYPE, dlsym(RTLD_DEFAULT, symbol));
if (fptr != NULL) {
    // Do something different because this platform supports 'symbol'
}
Devon_C_Miller
@Davon_C_Miller: Thank you! :)
solotim