chhaya Joshi 3 weeks ago

How to Set file path in java?

I don't want to start path from workspace and my file is in another project and i want to fetch that file in my project is there any way ?

Project structure

enter image description here

I want to fetch zmaayacomponents.json file in another project without starting path from workspace

Answers


vels4j 3 weeks ago

There are many ways, quickest one is you can set path in command line args like

-Dzmaayacomponents_file=<path>/zmaayacomponents.json

and read using

System.getproperties("zmaayacomponents_file");

Post Status

Asked in 3 weeks ago
Viewed 1,229 times
Voted 10
Answered 0 times

Search




Leave an answer