Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以在编码时我不小心点击了“clearProperty”而不是“getProperty”......我已经清除了“os.name”,现在每次我尝试阅读它时都会得到空值。如何将其恢复为通用状态?如果我不能自动做到这一点,我怎么知道我的窗口有确切的字符串?
编辑:
当您在 Eclipse 中键入“系统”时。你已经设置了所有可用的方法。我单击清除而不是获取和启动程序。
PS - 我知道这听起来不可能,但仍然......
只需重新启动有问题的 JVM。
调用clearProperty仅从哈希表中删除条目。如果您不想清除该属性,请删除调用它的行并再次运行该程序。
clearProperty
系统属性:
这些变化不是持久的。