File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes ant taskdef ZipException: Not a valid zip file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ant taskdef ZipException: Not a valid zip file" Watch "ant taskdef ZipException: Not a valid zip file" New topic
Author

ant taskdef ZipException: Not a valid zip file

Csaba Szegedi
Ranch Hand

Joined: Mar 27, 2010
Posts: 36
Hello,

I would like to use the ant-contrib, it works well, but before the result, I get this below:

Unable to obtain resource from /home/csaba/ant/apache-ant-1.9.0/lib/libraries.properties: java.util.zip.ZipException: Not a valid zip file
[taskdef] Unable to obtain resource from /home/myname/ant/apache-ant-1.9.0/lib/libraries.properties:
[taskdef] java.util.zip.ZipException: Not a valid zip file

Code which raise the exceptions:


How can I remove this kind of exceptions ?
Thanks in advance.

Cs.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

What all is in that lib directory? Ant doesn't like the properties file because it is not a zip file (jar files are zip files). Try using an includes directive to include only the jar files in the lib directory. Example:



JBoss In Action
Csaba Szegedi
Ranch Hand

Joined: Mar 27, 2010
Posts: 36
Hello Peter,

You were right.
The error can be more concrete, that was miss leading for me as a starter.

Thanks 3x

Peter Johnson wrote:What all is in that lib directory? Ant doesn't like the properties file because it is not a zip file (jar files are zip files). Try using an includes directive to include only the jar files in the lib directory. Example:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ant taskdef ZipException: Not a valid zip file
 
Similar Threads
Getting lib not found for MVC Example
start/stop Sun Application server from ant build.xml
Unable to set the JAVA_HOME build path
Odd exception with Axis 1.4 and ant taskdef
ANT: Build Fails: [taskdef] Could not load ... net/sf/antcontrib/antlib.xml