简体   繁体   English

Java 和 ProGuard - taskdef class proguard.ant.ProGuardTask 无法使用类加载器 AntClassLoader 找到

[英]Java and ProGuard - taskdef class proguard.ant.ProGuardTask cannot be found using the classloader AntClassLoader

I have the pleasure of working on a embeded java program, which was writen 10+ years ago from a third party company.我很高兴参与嵌入式 java 程序,该程序是 10 多年前由第三方公司编写的。 Source and project files were included.包括源文件和项目文件。

It was imported into Eclipse and ported to a higher java version (17).它被导入到 Eclipse 并移植到更高的 java 版本(17)。

Now I'm stuck when trying to build the program.现在我在尝试构建程序时被卡住了。 It uses ProGuard.它使用 ProGuard。 The newest version was added to the project files.最新版本已添加到项目文件中。 Config file proguard.pro was changed to discard rt.jar utilization in favore of the new methods.配置文件 proguard.pro 已更改为放弃 rt.jar 利用率以支持新方法。 However, now I'm getting a error message:但是,现在我收到一条错误消息:

BUILD FAILED
C:\mypath\build.xml:16: taskdef class proguard.ant.ProGuardTask cannot be found
 using the classloader AntClassLoader[C:\mypath\obf\proguard.jar]

build.xml (original) is as follows: build.xml(原版)如下:

<target name="obfuscate" description="obfuscate a jar file" depends="jar">
    <taskdef name="proguard" classname="proguard.ant.ProGuardTask" classpath="obf/proguard.jar" />
    <proguard configuration="obf/proguard.pro" />
</target>

The 'obf' folder is inside the project (sublevel of build.xml). “obf”文件夹位于项目内(build.xml 的子级别)。 File proguard.jar is inside of it.文件 proguard.jar 在里面。 Anyone haveing any clues why would this error show?任何人都有任何线索为什么会显示此错误? No other changes were made beside the listed ones.除了列出的更改之外,没有进行其他更改。

So, it turned out that with new versions, the notation is not as it once was.因此,事实证明,对于新版本,符号与以前不同。

<taskdef resource="proguard/ant/task.properties" classpath="${proguard.path}/lib/proguard-ant.jar" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM