Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Location of Input Files 1

Status
Not open for further replies.

NeilV

Programmer
Oct 14, 2002
117
GB
Hi,

I have created some classes that I want to use for several programs. Some of these classes require input files (for configuration data etc). I have kept the classes in a seperate location (ie windows folder) from the application and included the path to the classes in my classpath. I can get my applications to compile without error but the only way I can get them to run is to place the input files required by classes in the same location as the application using them. I would ideally, like to keep the classes and their input files in the same location. How can I do this??
In my code i do not have any paths, I have only specified file names.

Thanks,

Neil
 
If its a standalone program, you could pass in a "base" location of the command line :

java -Dapp.home=C:\some\path YourApp

Then once your application is started you can get the location like this :

String base = System.getProperty("app.home");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top