Loading files from java jar file


This question already has an answer here:


If you change the name of your XXX.jar file to XXX.zip, then open it in whatever Zip file utility you might have available, you can look inside the file and see 1. Whether your files are getting included in the jar at all, and if they are, 2. the actual path in which they are stored. I strongly suspect there's now src folder inside your jar.

Also, if you're NOT expecting the files to be in the jar, then you'll probably need to supply an absolute path to the files.

If they are in the jar, then check out these questions:

load file within a jar,

How to use ClassLoader.getResources() correctly?,

How do I list the files inside a JAR file?

Need Your Help

insert several row in order to satisfy a constraint

postgresql transactions constraints

I have two table: deck(id) and card(deck,color,value)

Does IE 7 have any memory limitations when recieving a dynamically generated PDF? If so, does anyone have a workaround?

internet-explorer browser

Our system dynamically generates a large report by converting many HTML pages into a single PDF. The resulting PDF is sent back (via the HTTP request) to the calling browser. When the report is

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.