C
cppaddict
I have an application which uses outside data files. That is, it has
lines of code like this:
DataReader.loadFile("data/MyFile.dat");
Right now the app is just a bunch of .class files and I start it on
the command line from the appropriate directory to ensure that the
data files can be found.
But I want to package the app as a .jar (a .jar which includes the
data files) and be able to run the .jar from any directory. That is,
when it's running, java should search for the data files relative to
the .jar root, rather than relative to the root where the process was
started.
How can I do this?
Thanks,
cpp
lines of code like this:
DataReader.loadFile("data/MyFile.dat");
Right now the app is just a bunch of .class files and I start it on
the command line from the appropriate directory to ensure that the
data files can be found.
But I want to package the app as a .jar (a .jar which includes the
data files) and be able to run the .jar from any directory. That is,
when it's running, java should search for the data files relative to
the .jar root, rather than relative to the root where the process was
started.
How can I do this?
Thanks,
cpp