创建具有外观和感觉库罐的jar

时间:2014-03-28 18:05:00

标签: java executable-jar

在我的java项目中,我看起来感觉jar文件。

 try {
            UIManager.setLookAndFeel("de.javasoft.plaf.synthetica.SyntheticaBlackEyeLookAndFeel"); 


     } catch (Exception ex) { 
        }

所以当我为我的项目创建jar文件时,它会生成jar和一个包含那些看起来感觉jar的lib文件夹。当我将两个文件夹复制到新的地方时,它运作良好

但是当我只复制jar时,它默认打开了感觉

有没有办法解决它

1 个答案:

答案 0 :(得分:0)

检查build.xml文件 - 您可能需要编辑build.xml文件以合并JAR中的这些JAR文件。

    <!-- Change the value of this property to be the name of your JAR,
         minus the .jar extension. It should not have spaces.
         <property name="store.jar.name" value="MyJarName"/>
    -->
    <property name="SOR.jar.name" value="MarsRoverViewer"/>


    <!-- don't edit below this line -->

    <property name="store.dir" value="store"/>
    <property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>

    <echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/>

    <delete dir="${store.dir}"/>
    <mkdir dir="${store.dir}"/>

    <jar destfile="${store.dir}/temp_final.jar" filesetmanifest="skip">
        <zipgroupfileset dir="dist" includes="*.jar"/>
        <zipgroupfileset dir="dist/lib" includes="*.jar"/>

        <manifest>
            <attribute name="Main-Class" value="${main.class}"/>
        </manifest>
    </jar>

    <zip destfile="${store.jar}">
        <zipfileset src="${store.dir}/temp_final.jar"
        excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/>
    </zip>

    <delete file="${store.dir}/temp_final.jar"/>

</target>
相关问题