We create some logs and other meta data files for use during the duration of the java app. We would like to make sure they are created and looked for in the same place everytime no matter what the file structure of the users computer looks like. So, we would like to create these files near the class files since that shouldn't change after the app is installed.
No it won't be .. when the user installs the app they are allowed to install it anywhere they want. So there is no guarantee where the jar file will end up when the app is started and the files need to be created.
I mean if your apps records the path the user choses to install it to and then writes it to the registry. In short, that's what it boils down to. It must record the path and store it somewhere that will ALWAYS BE IN THE SAME place. Otherwise it's the long winded method.
The system classloader hides all that from you.
There is no way to find out the filesystem location of a classfile, only the classloader that loaded it.
And you wouldn't need to anyway.
Create your installer in such a way that it writes a configuration file containing the desired location of the logfile, and use that to determine where the log is to be written.
Or use the registry (more correctly the configuration API, which determines based on OS capabilities where to store settings).