File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes tomcat - read external properties file from jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "tomcat - read external properties file from jar" Watch "tomcat - read external properties file from jar" New topic
Author

tomcat - read external properties file from jar

Quiddo Quitch
Ranch Hand

Joined: Apr 21, 2008
Posts: 38
I created a jar (myjar.jar) file that I placed in the lib directory of my webapp. The jar file I created needs to read from a properties file that is in a different directory. When I try to specify the path to this properties file I am getting an exception.

The code I am using



Dir structure below

How can I specify the correct path?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

What exception are you getting?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tomcat - read external properties file from jar
 
Similar Threads
Classpath Issues with java -jar option
Path to store Embedded Database files
WSAD & JAR Files
Best place for .properties file?
Writing to properties file in WEB-INF