posted 22 years ago
The code posted will not necessarially look in the current directory. It will look at the same ClassLoader that loaded MyClass. So my.properties should be in the same location (classpath entry) as MyClass.
For example, if MyClass is com.foo.MyClass and is in mystuff.jar then the my.properties file should be in mystuff.jar also.
If MyClass is in a directory like /home/devel/classes/com/foo/MyClass.class, then my.properties should be at /home/devel/classes/my.properties.
If you put them in the same place, then this will always work - if the ClassLoader can load MyClass it should also then find my.properties.