Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] AdBookWorkaround



Christopher SEKIYA wrote:

>>[LHS] Any tips or links where I can find out how to rebuild the jar?
>>    
>>
>
>file FILENAME.jar
>  
>

Am I on the right track with this?:


      e383. Writing a JAR File Manifest to a File

The format of a manifest file is described in:

    http://java.sun.com/products/jdk/1.2/docs/guide/jar/manifest.html

This example retrieves the manifest from a JAR file and writes the 
manifest contents to a file.

    try {
        // Open the JAR file
        JarFile jarfile = new JarFile(/"filename.jar"/);
    
        // Get the manifest
        Manifest manifest = jarfile.getManifest();
    
        // Write the manifest to a file
        OutputStream fos = new FileOutputStream(/"manifest"/);
        jarfile.getManifest().write(fos);
        fos.close();
    } catch (IOException e) {
    }

Here's an example of a manifest file:

    Manifest-Version: 1.0
    Specification-Title: Java Platform API Specification
    Specification-Version: 1.4
    Implementation-Title: Java Runtime Environment
    Implementation-Version: 1.4.0-rc
    Created-By: 1.4.0-rc (Sun Microsystems Inc.)
    Implementation-Vendor: Sun Microsystems, Inc.
    Specification-Vendor: Sun Microsystems, Inc.
    
    Name: javax/swing/JScrollPane.class
    Java-Bean: True
    
    Name: javax/swing/JCheckBoxMenuItem.class
    Java-Bean: True
    
    Name: javax/swing/JTabbedPane.class
    Java-Bean: True
    
    Name: javax/swing/JMenuItem.class
    Java-Bean: True
    
    Name: javax/swing/JTable.class

    Java-Bean: True




Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links