Code example for Attributes

Methods: put

        // play with relative file names - put relative path as ../<parent dir 
        // name>/xx.jar 
        att.put(Attributes.Name.CLASS_PATH, ".." + File.separator
                + barJar.getParentFile().getName() + File.separator
                + barJar.getName());
        joutFoo = new JarOutputStream(new FileOutputStream(fooJar), man);
        joutFoo.putNextEntry(new JarEntry("foo/bar/execjartest/Foo.class"));
        joutFoo.write(getResource(resources, "hyts_Foo.ser"));
        // execute the JAR and read the result 
        assertTrue("Error executing JAR",
                execAndGetOutput(builder).startsWith( "FOOBAR"));
     * tests case when Main-Class is not in the jar launched but in another jar 
     * referenced by Class-Path 
     * @throws Exception in case of troubles 
Connect your IDE to all the code out there  Get Codota for Java