This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes can't find correct classpath for the required properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "can Watch "can New topic
Author

can't find correct classpath for the required properties file

Max Bean
Ranch Hand

Joined: Mar 09, 2006
Posts: 31
As I've been trying to make something like:

FileInputStream propFile = new FileInputStream("src/props/myProperties.txt");

but the compiler keeps complain:

Caused by: java.io.FileNotFoundException: class path resource [src/props/myProperties.txt] cannot be opened because it does not exist

Any suggestion about the thing/article/stuff to read on, and then I can obtain sharp understanding to get it done myself?

Thnx
Mr Newbie
Gaurav Faujdar
Greenhorn

Joined: Apr 11, 2007
Posts: 7
try something like

to know where you program is trying to read the file from.
[ August 01, 2007: Message edited by: Gaurav Faujdar ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: can't find correct classpath for the required properties file