Click here to Skip to main content
15,885,164 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have to read and process the config.ini file in java, config.ini file is placed in the directory where jar files are placed. Please provide solution.
Posted

1 solution

First you have to get the directory in which the jar file is located: http://stackoverflow.com/questions/320542/how-to-get-the-path-of-a-running-jar-file[^]
If you have the directory then loading/processing a file in it is straightforward.
 
Share this answer
 
Comments
H.Brydon 15-Aug-13 1:48am    
Good info, +5... I will likely use it myself.
pasztorpisti 15-Aug-13 4:38am    
Thank you! I used it only once and it worked perfectly. According to some it doesn't work in some cases, I guess those cases are some special scenarios where you are using the jar from an appserver or something similar. Commandline jar launching should work without problems.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900