I want my java desktop application to find out if it runs it for the first time on this computer. Since the jar file can be shared between users, I do not want to write to the file inside the jar file. Obviously, there are many ways to do this, but what do you recommend? (It must be cross-platform). thank
Try using Preferences and systemRoot () or userRoot () to get system-wide or user settings.
, . , , .
System.getProperty("user.home"); // returns the home directory cross platform
, (/home, C:\Users, C:\Documents and settings). JVM System.home.
/home
C:\Users
C:\Documents and settings
, . , ( " ", , ), , .