It works fine without being static. It modifies a class member anyway. We'd have to make exe_path static as well if we do that .