get the source code path
I have problem :
In the program I need to read some text file that is in the same dir as the source ( both java and class files) .
to extact the path.
The problem :
when ever I run my program from differnet directories , the currect directory is change.
So unless I'm running from the java files dir - the program dont work - what to do ?
You want a text file from the .class file folder, not the source.
Look at ClassLoader.getResource(). Look out for the funny use of "/" to define the package name.