Yes, given the compatibility constraint and the fact that the registered shutdown hook is static, having a system property is probably the best option.