I am using eclipse ide for my java projects
and in eclipse there is an option to export the project as a runnable jar file
and it creates MINIFEST.MF file which has all the information about the main method and other jar's used by the code
and in my code i am using
now when i run my code using eclipse , it finds abc.properties file
but when i am running through command prompt
java -jar <jar-file-name> args
now i believe there is some class path problem
i have set the classpath in my environmental variables but still cannot find above file from class path
Don't set the classpath as an environment variable.
Make sure the file is in the correct location. You will have a current directory, where you can invoke your classes with
That is the sort of "root" for your package structure. Try copying the file into that location and see whether that improves things. If that doesn't help, don't know, sorry.
Joined: Sep 18, 2009
I moved my properties file at the level where META-INF folder is there in jar file and
my code worked, i mean ClassLoader could find the file there
but if i want the file to be any where on the machine and the path will be set in classpath
then how do we achive that?