wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes java.io.FileNotFoundException: FileOutputStream error? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java.io.FileNotFoundException: FileOutputStream error?" Watch "java.io.FileNotFoundException: FileOutputStream error?" New topic

java.io.FileNotFoundException: FileOutputStream error?

Al Cap

Joined: May 24, 2010
Posts: 1
Why I am getting a "java.io.FileNotFoundException: resources\Derby.properties (The system cannot find the path specified)" in the SetProperty method. The same "resources\Derby.properties" file is opening up in the GetProperty method without any problem.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24183


Welcome to JavaRanch!

Well, getResourceAsStream() looks for a resource relative to the roots of the class path; it can find files inside jars. But "new FileOutputStream()" expects a path that's relative to the current working directory, and can only open real files for writing. You're not trying to write into a file inside a jar file, are you?

[Jess in Action][AskingGoodQuestions]
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10270

In future, while posting code, please UseCodeTags

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
I agree. Here's the link: http://aspose.com/file-tools
subject: java.io.FileNotFoundException: FileOutputStream error?