I have a Java desktop application that I wrote. At run time, I create the folders and files by default specified on the system.
Java.io.files clearly states: By default the classes in the java.io package always resolve relative pathnames against the current user directory. This directory is named by the system property user.dir, and is typically the directory in which the Java virtual machine was invoked. By default the classes in the java.io package always resolve relative pathnames against the current user directory. This directory is named by the system property user.dir, and is typically the directory in which the Java virtual machine was invoked.
In addition, I use IzPack to create installation and create shortcuts.
When I run my application on my computer with XP, after installation I get a shortcut on the desktop, and the specified files and folders are created in the place where Izpack installed the Jar. which is the expected behavior.
But when I test this on a Vista machine, folders and files are created on the desktop! even if the Jar is in the right place (c: \ program files .. etc.).
I want these files to be created in the same folder that the Jar is in, and certainly not on the desktop.
Can someone give me an idea of ββwhat is going on here?
source share