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.
我试图让我的主要可执行 jar 文件将自身复制到另一个位置。
我怎样才能做到这一点?
return new File(MyClass.class.getProtectionDomain(). getCodeSource(). getLocation(). getURI(). getPath()).getName();
将返回全名