• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.io.FileNotFoundException: FileOutputStream error?

 
Al Cap
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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?
 
Maneesh Godbole
Saloon Keeper
Posts: 11173
14
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Al,
In future, while posting code, please UseCodeTags
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic