java - File Not found exception on different Machine -


i trying access file opt/app/db/vat/form_data_30.xls. works fine on machine shows exception on other machine on application installed. here code

string filename="opt/app/db/vat/form_dvat_30.xls"; file selectedfile=new file(filename);  

physically .xls file exist inside opt/app/db/vat directory.and users have permission of read write well. mine runnable jar app.jar stored @ /opt/app/app.jar

if use string filename="opt/app/db/vat/form_dvat_30.xls"; relative execution folder.

for example if programe executed /home/user/ file should in /home/user/opt/app/db/vat/form_dvat_30.xls

if want access /opt/app/db/vat/form_dvat_30.xls use string filename="/opt/app/db/vat/form_dvat_30.xls";


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -