Find where Java loads files from? -


I was just thinking that the Java program is searching for a file, there is a way to find out.

I am trying to load a setting file with the FileInputStream fstream = new FileInputStream ("ldaplookup.ini"); But this is not a file found error Ini file is in the same folder as the square file, but I'm assuming that it is searching somewhere else.

Thanks, -Pet

File appears relative to the path of file inputstream execution is. If the resource file is in the same folder as the file class, then you can try it using:

  InputStream stream = this.getClass (). GetResourceAsStream ("ldaplookup.ini");  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -