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).
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...