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.
有谁知道如何在 OSx 中卸载 java 中的驱动器
我正在尝试从 java 中卸载 SD 卡。我正在使用 java Swing 类并且驱动器会自动挂载,但是如何卸载它。
挂载/卸载的概念与平台无关,因此它不直接存在于 Java API 中。您很可能必须通过使用发出命令行调用来卸载Runtime.exec()
Runtime.exec()
可能有可用的开源库可以为您包装这个 exec 调用,但我并不肯定。
您可以使用Runtime.exec调用umount。当然,这个解决方案是不可移植的。