Detect first time user in java app

后端 未结 3 720
太阳男子
太阳男子 2021-01-13 07:35

I want my java desktop application to know if the user is running it for the first time on that pc. Since the jar-file might be shared between users i don\'t want to write t

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-13 08:07

    I would recommend using the users home directory where you can place a user specific settings file. This will allow you to detect first time users as well as remember any preferences they may choose.

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

提交回复
热议问题