Archive for required library in project cannot be read [message #1694796] |
Thu, 07 May 2015 21:20  |
Eclipse User |
|
|
|
Would you please explain why I am getting the error below when adding a .jar to a project as a User Library?
I have a Java class that will import classes that are in a .jar. The .jar and dll are provided by a third party (Hewlett Packard).
1. Select project Test1 in the Package Explorer window
2. Select Properties, Java Build Path, Libraries folder, Add External JARS
3. Click on tdmext.jar.
Error: Archive for required library: 'C:<path>/tdmext.jar' in project 'Test1' cannot be read or is not a valid ZIP file.
I believe tdmext.jar is valid because I can run the Java class from the Korn shell command line and include tdmext.jar in the classpath:
java -classpath /home/xxx/java:/usr/tandem/javaexth11/lib/tdmext.jar Test
I also believe tdmext.jar is valid because it is being used in production.
It appears that the project knows the .jar is a User Library:
Select project Test1, Build Path, Configure Build Path, Libraries tab
JARS and class folders on the build path:
tdmext.jar - C:\Users\xxx\Documents\library
|
|
|
Re: Archive for required library in project cannot be read [message #1694882 is a reply to message #1694796] |
Fri, 08 May 2015 12:13   |
Eclipse User |
|
|
|
On 05/08/2015 06:41 AM, Marlene Miller wrote:
> Would you please explain why I am getting the error below when adding a
> .jar to a project as a User Library?
>
> I have a Java class that will import classes that are in a .jar. The
> .jar and dll are provided by a third party (Hewlett Packard).
> 1. Select project Test1 in the Package Explorer window
> 2. Select Properties, Java Build Path, Libraries folder, Add External JARS
> 3. Click on tdmext.jar.
>
> Error: Archive for required library: 'C:<path>/tdmext.jar' in project
> 'Test1' cannot be read or is not a valid ZIP file.
>
> I believe tdmext.jar is valid because I can run the Java class from the
> Korn shell command line and include tdmext.jar in the classpath: java
> -classpath /home/xxx/java:/usr/tandem/javaexth11/lib/tdmext.jar Test
> I also believe tdmext.jar is valid because it is being used in production.
>
> It appears that the project knows the .jar is a User Library:
> Select project Test1, Build Path, Configure Build Path, Libraries tab
> JARS and class folders on the build path:
> tdmext.jar - C:\Users\xxx\Documents\library
What happens when, at the command line at C:<path>\, you do
$ jar tvf tdmext.jar?
|
|
|
Re: Archive for required library in project cannot be read [message #1694889 is a reply to message #1694882] |
Fri, 08 May 2015 14:34  |
Eclipse User |
|
|
|
Thank very much Russell. I know reason for the error now.
On Windows 7:
C:<path>> jar tvf tdmext.jar
java.util.zip.ZipException: invalid CEN header (bad signature)
On HP NonStop:
Korn shell: jar tvf tdmext.jar
<a normal list of class files>
When I copied tdmext.jar from the HP NonStop to Windows7, I copied in ASCII mode (default). Now, when I copy in binary mode, there is no error.
Many thanks for your help and time.
- - - - -
BTW I followed the links in your Eclipse profile to your article JAR Libraries Tutorial. I will study this.
|
|
|
Powered by
FUDForum. Page generated in 0.07931 seconds