⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e381. listing the main attributes in a jar file manifest.txt

📁 这里面包含了一百多个JAVA源文件
💻 TXT
字号:
The main attributes of a JAR file are values that are associated with the JAR file itself, not with any particular entry. 
    try {
        // Open the JAR file
        JarFile jarfile = new JarFile("filename.jar");
    
        // Get the manifest
        Manifest manifest = jarfile.getManifest();
    
        // Get the main attributes in the manifest
        Attributes attrs = (Attributes)manifest.getMainAttributes();
    
        // Enumerate each attribute
        for (Iterator it=attrs.keySet().iterator(); it.hasNext(); ) {
            // Get attribute name
            Attributes.Name attrName = (Attributes.Name)it.next();
    
            // Get attribute value
            String attrValue = attrs.getValue(attrName);
        }
    } catch (IOException e) {
    }

Here's an example of main attributes for a JAR file: 
    Attribute Name: Attribute Value
    
    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 (Sun Microsystems Inc.)
    Manifest-Version: 1.0
    Implementation-Vendor: Sun Microsystems, Inc.
    Specification-Vendor: Sun Microsystems, Inc.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -