Java System.getProperty(“user.dir”) on Mac OS X

后端 未结 2 1926
感动是毒
感动是毒 2021-01-26 03:57

I have an application bundle on Mac OS X 10.4 on the desktop. My application looks for a folder named \"resources\" in which files to be displayed are kept (kept in the same loc

2条回答
  •  时光说笑
    2021-01-26 04:46

    I instead used the system property "user.home" instead of "user.dir". This way i do not have to worry about where the JVM is looking. I have the application bundle refernce my jar file directly using a bash script as the executeable called by the info.plist file. i can always place the files to be displayed by the app on the users home because that location will always return a path.

提交回复
热议问题