Mark Wielaard <mark <at> klomp.org> writes: > The problem is that some runtimes (like cacao and jamvm) dynamically > load the "javalang" reference library through System.loadLibrary(). But > we were relying on Math to do this since obviously it cannot be done in > (VM)System/Runtime directly while those are being initialized. > > I have tried to find a better spot in the bootstrap cycle to do this, > but couldn't find one. Ideas welcome. > > For now to get things working I just reintroduced the loadLibrary() call > in the Math static initializer. This should work as before the > Math/VMMath split even though it is a little ugly.
Another dumb question: Could you just do something like: public class Math { static { VMMath.initialize(); } ... } class VMMath { static void initialize() { System.loadLibrary("javalang"); } ... } Or do the timing rules of class initialization make that impossible or impractical somehow?