Thanks for the info. Actually I'm putting some XML configuration files into a JAR file. They don't need to be in the classpath per se. I just need a portable way to get to them.
-Chris ----- Original Message ----- From: "Shapira, Yoav" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Monday, July 29, 2002 1:19 PM Subject: RE: opening JAR file from within Tomcat App Hi, It's somewhat unusual to read a JAR file (containing only compiled .class files?) at runtime. Are you doing some sort of fancy reflection work? Anyways, to your question. Do you need the file to be on the classpath, i.e. its classes visible to the classloader? Or do you only need to open it up yourself? If you only need to look inside it yourself, put in under /MyApp/myjar.jar. Then you get do stuff like ServletContext.getResource("/myjar.jar") or ServletContext.getRealPath("/myjar.jar"). Yoav Shapira Millennium ChemInformatics >-----Original Message----- >From: Chris Ruegger [mailto:[EMAIL PROTECTED]] >Sent: Monday, July 29, 2002 1:21 PM >To: Tomcat Users List >Subject: opening JAR file from within Tomcat App > > >I need to open a JAR file from within my Tomcat app and read some of >the files. Question: What's the best way to get the absolute path Name >of the Jar file so that I can pass that name to a JarFile object? > >I tried placing the JAR file in the WEB-INF\lib directory thinking its full >path name would show up when I performed: >System.getProperty("java.class.path"). However, this call returns only >the JDK tools.jar file and the tomcat bootstrap.jar file, even though >I have many JAR files in my WEB-INF\lib. > >What approaches have other folks used for this? >Thanks -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>