如何找到Java应用程序的安装目录?
我需要找到Java应用程序的安装目录。我将使用它来查找不在类路径上的资源。最好的解决方案是什么?此代码将为您提供类文件在系统中执行的位置如何找到Java应用程序的安装目录?,java,path,installation,directory,classpath,Java,Path,Installation,Directory,Classpath,我需要找到Java应用程序的安装目录。我将使用它来查找不在类路径上的资源。最好的解决方案是什么?此代码将为您提供类文件在系统中执行的位置 this.getClass().getProtectionDomain().getCodeSource().getLocation();
this.getClass().getProtectionDomain().getCodeSource().getLocation();