我正在使用Ubuntu x64 15.04和netbeans ide我正在尝试使用proguard所以创建了proguard.pro文件:
-libraryjars /usr/lib/jvm/jdk1.8.0_60/jre/lib/rj.jar
-libraryjars libs/json-simple-1.1.1.jar
-libraryjars libs/sqlite-jdbc-3.8.10.1.jar
-injars dist/MyApp.jar
-outjars dist/MyApp-v1.jar
-keepclasseswithmembers public class * {
public static void main(java.lang.String[]);
}
-optimizationpasses 3
-overloadaggressively
-repackageclasses ''
-allowaccessmodification
-printmapping proguard-mapping.txt
并修改了build.xml
文件:
<project name="MyApp" default="default" basedir=".">
<description>Builds, tests, and runs the project MyApp.</description>
<import file="nbproject/build-impl.xml"/>
<target name="-post-jar">
<taskdef resource="proguard/ant/task.properties" classpath="libs/proguard/proguard.jar" />
<proguard configuration="proguard.pro"/>
</target>
</project>
但是当我尝试编译和构建MyApp时,我遇到了以下错误:
ProGuard, version 5.2.1
Reading program jar [/home/muhammad/java/MyApp/dist/MyApp.jar]
Reading library jar [/usr/lib/jvm/jdk1.8.0_60/jre/lib/rj.jar]
/home/muhammad/java/MyApp/build.xml:8:
Can't read [/usr/lib/jvm/jdk1.8.0_60/jre/lib/rj.jar] (No such file or directory)
BUILD FAILED (total time: 0 seconds)
如果任何人可以帮助我解决这个错误,那将是很好的,此时我只能考虑更改/usr/lib/jvm/jdk1.8.0_60/jre/lib/rj.jar
的权限,以便netbeans可以访问它,但想知道它是否好要做到这一点..还是有正确的解决方法......提前谢谢。
答案 0 :(得分:0)
也许是一个错字---你的意思是rt.jar?