As has already been mentioned in the comments, the Java spec mandates that a static constructor should run right before the first time the class is used. Quick-and-dirty solutions, such as adding a static member whose constructor contains the given code, do not satisfy that requirement. So you'll need to control the order in which the initialization happens yourself rather than relying on C++ features to take care of that for you.
The easiest way to do that would be to add a static member variable to keep track of whether the class has been initialized and a static method to initialize it. The static method would run the code from the static initializer block if (and only if) the class has not been initialized yet. Afterwards it would set the member to true. Now you can insert calls to the static method right before any use of the class and it will behave as specified.