Java executable .jar - spaces in directory path
Posted on 2001-06-23
I have an executable .jar file (in Windows), that is a Swing application. When I start it by double-clicking on it, it will start only if the path it is in has no spaces in the directory path. (For example, c:\program files\myapp will not work since "program files" contains a space.
On the other hand, it will always start if it started from the command line (ie. java -jar My.jar). I know the double-click invokes javaw (instead of just java), but I don't understand why one works and the other doesn't.
I do access "user.dir" and append a subdirectory to it in my code. Could this be part of the issue? However, why does the command line invocation work?