View RSS Feed

Recent Blogs Posts

  1. Accessing Resources in a JAR File

    by , 11-28-2011 at 07:05 PM (My Java Tips)
    JAR files are used to deploy applications. They comprise of java classes and other resources like images etc. In this post, I will explain how to access resources packed in a JAR file.

    To access resources in a JAR file, we use getResource method. Lets do this practically. The code snippet provided shows how to retrieve images from a JAR file.

    Java Code:
    // Get current classloader
    ClassLoader cl = this.getClass().getClassLoader();
    // Create icons
    Java SE
  2. How To Modify A JAR File

    by , 11-08-2011 at 07:40 PM (My Java Tips)
    This assumes a basic understanding about the JAR API's provided by Sun, To know more click here. Now this is a step ahead of that, by which you will be able to add or delete a particular file to the JAR archive.

    Listed below is an example that adds a file to an existing JAR or ZIP file. In the program an intermediate file is created first that will be later replaced with an existing one. To be more precise the intermediate file will be renamed to original one after deleting the old ...
    Tags: jar file Add / Edit Tags
    Java SE