First user discovery in java application

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

+5
source share
3 answers

Try using Preferences and systemRoot () or userRoot () to get system-wide or user settings.

+4
source

, . , , .

System.getProperty("user.home"); // returns the home directory cross platform
+7

, (/home, C:\Users, C:\Documents and settings). JVM System.home.

, . , ( " ", , ), , .

0

All Articles