How are people specifying the location of the local db.db? I'm hesitant to hard code the location, so I want to use a properties file. I've had success with this approach running my app from an IDE and from the command line, but not from within an executable jar. Should I just not bother and hard code the location, or should I not expect the user to use an executable jar? Thanks
Sai Prasad
Ranch Hand
Joined: Feb 25, 2002
Posts: 560
posted
0
You are allowed to pass the db name as the command line configuration parameter.
Or you could hard code it from the standpoitn of relative path. Either in the same DIR as the executable jar, or a subdirectory of it. Look at System.getProperty("user.dir") Mark
Hi..I don't think you need to speify any relative path..please correct me if i'm wrong..but when you call new File("db.db")..doesn't the JVM look in the current directory?? So what's the point of System.getProperty("user.dir")?...I'm not sure about this..so all reponses will be of great help!! Pallav
Lance Finney
Ranch Hand
Joined: Apr 26, 2001
Posts: 133
posted
0
Originally posted by Mark Spritzler: Or you could hard code it from the standpoitn of relative path. Either in the same DIR as the executable jar, or a subdirectory of it. Look at System.getProperty("user.dir") Mark
So, you suggest extracting db.db in the same directory as the exectuable jar. I guess that would work. For some reason, I was thinking that I would want to keep db.db within the jar, but I guess that wouldn't work. Interesting.