I have written a java program which different classes where during the process it generates lots of files (say txt files) and then reads the files and operates on them. I have made the project as a JAR file where I can run it from command with no problem as JAR is in the same directory.
However, I want to run this JAR file on a remote server where the PATHs are not the same, so then it generates error, because in my project for instance it should read a file from /Programs/Folder/here whereas in the server this cannot happen as there is no /Programs/Folder… directory. Do I have to change all the paths in my program according to the new location I wanna put my jar or there is another way around it?
I would appreciate your help.
Best wishes
I have written a java program which different classes where during the process it
Share
what i prefer is i use relative path and then read relative path using classloader.try it.