There are two things you can do.
1) If the file needs to be supplied by the user, take the location as an argument. Also use this approach if you want the application to fail without the user input.
public static void main(String... args) {
String location = args[0];
... // Do Stuff
}
2) If the file is static, package it in your jar and read it as a resource.
public static void main(String... args) {
InputStream input = FileClass.getClass().getClassLoader().getResourceAsStream("test.txt")
... // Do Stuff
}
When it's a properties file, my preference is a combination of the two. Define your default properties and package them. Then, allow the user to overwrite the values by supplying their own properties. Load the properties from the classpath (example two), and then replace any values from the file the user supplies (example one).