import java.lang.reflect.Field;

class X {
    public static boolean fieldName = false;
}

class Allocator {
    public static void allocate(Class c) throws Exception {
        Field field = c.getDeclaredField("fieldName");
        field.set(null, true /* новое значение */);
    }
}

public class Main {
    public static void main(String[] args) throws Exception {
        System.out.println(X.fieldName);
        Allocator.allocate(X.class);
        System.out.println(X.fieldName);
    }
}