I've created an application that is a runnable jar (using maven-assembly plugin) with a couple of user-configurable resources that sit along side it in the same directory (images, properties, etc.)
When running the jar from the command line with java -jar ...
the current directory is as you would expect. The problem is that on some operating systems (Ubuntu 11.04), if the application is started by simply double clicking the jar then the current working directory is the home directory.
Is there a preferred way of getting the current directory that the jar is in, or another method altogether for accessing external resources that sit alongside the jar?