0

我正在使用 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 可以访问它,但想知道这样做好不好..还是有解决它的正确方法..提前谢谢。

4

1 回答 1

0

也许是一个错字---你的意思是 rt.jar 吗?

于 2015-09-18T13:10:30.390 回答