Home Ask Login Register

Developers Planet

Your answer is one click away!

chhaya Joshi December 2016

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 December 2016

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 December 2016
Viewed 1,229 times
Voted 10
Answered 0 times

Search




Leave an answer


Quote of the day: live life