I'm currently creating a password safe type of application and I'm stuck at the login. Currently, the user can create an account and select the place where the data will be saved (via object serialization) using JFileChooser. This all works fine. The problem is that when the user closes the application and tries to login (without creating a new account) the application doesn't know where the login data is saved and thus can't check if the login credentials are valid. Besides making the user show the application where the save data is every time they log in, how can I fix this?
Asked
Active
Viewed 51 times
0
-
Associate a location with the user credentials, so when the login you can look up where the file is. Basically you'd store this in common/well known location, [for example](http://stackoverflow.com/questions/27974857/where-should-i-place-my-files-in-order-to-be-able-to-access-them-when-i-run-the/27974989#27974989) – MadProgrammer May 05 '16 at 21:28
1 Answers
0
You have 3 basic options:
- Keep the password file in a relative location to the .jar, so it always knows where to find it.
- Pass variables to the application via the command line.
- Have the application look up an environment variable.

aglassman
- 2,643
- 1
- 17
- 30