Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Archive for required library in project cannot be read
Archive for required library in project cannot be read [message #1694796] Fri, 08 May 2015 01:20 Go to next message
Marlene Miller is currently offline Marlene MillerFriend
Messages: 6
Registered: May 2015
Junior Member
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 16:13 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

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 18:34 Go to previous message
Marlene Miller is currently offline Marlene MillerFriend
Messages: 6
Registered: May 2015
Junior Member
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.
Previous Topic:Application based on Eclipse sets error code: Window opens
Next Topic:the import cannot be resolved
Goto Forum:
  


Current Time: Tue Oct 27 22:07:25 GMT 2020

Powered by FUDForum. Page generated in 0.02482 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top