I have written a java program
- generates lots of files (say txt files) in different directories
- and then reads the files and operates on them
I have exported the project as a runnable jar.
I need to run the jar on a remote server, obviously PATHs are not the same
What options do I have
- Change path locations
- Or is there another way out ?
Additionally I use different external programs that generate more files. And my program needs to read these files too.
Well it sounds like you need to be able to configure what your program does. How you do that is up to you. For example:
The last option is probably the most flexible. Read the config file, which then contains all the other file locations you need. Each deployment can have a different config file.