Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jar files

 
vaitheeswaran subramanian
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i would like to add a properties file in the jar package and i want the class files in the package to access the properties file. i always get a file not found error. what is the way of implementing it.
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using Classloader.getResourceAsStream() to open the file? Since there's no actual file (it's in the JAR), you can't get to it using the normal File operations.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic