I wonder if I'm doing anything wrong. I created a sample JAR file, and set the directory which contains that JAR file in the classpath. I tried running the JAR file somewhere else, but it doesn't work. It's called "runme.jar", and I placed it in my root folder (C:\). I place "C:\" in the classpath, then I tried running the JAR file somewhere else with:
java -jar runme.jar
It doesn't work. I tried putting "C:\runme.jar" in the classpath too, but it doesn't work too.
By the way thanks for the "user.dir" solution. I've forgotten that such a property exists.