I need to access a file that isn't relative to the directory that the .jar file is in.

I got lucky with another part of the program doing this, but I really don't know how.

Thanks,
Jack

Recommended Answers

All 2 Replies

You can specify a full path from the root (eg c:) to the file, check out the API doc for File. You can also get useful directories like the user's home dir or a temp directory from System.getProperty, eg System.getProperty("user.home") and use that to locate a file.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.