• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

How Do I Read the Table of Contents of a JAR File?

 
Ranch Hand
Posts: 244
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How Do I Read the Table of Contents of a JAR File?

I'm trying to take a look at a project off of "sourceforge.net" that has four JAR files. I'd like to take a look at the contents of those four JAR files, so I tried executing "jar -t j6plugin-0.2.jar". Nothing happened; the prompt didn't come back; after a while I just hit control C and aborted it. Then I tried "jar -t -f j6plugin-0.2.jar"; that's running right now, but it's been running for about five minutes, without showing any results. Are either of those two commands the right way to see the table of contents of a JAR file? If not, what is the right way to see the table of contents of a JAR file? File "j6plugin-0.2.jar" is not huge; it's only got 4775 bytes. Any information on this would be greatly appreciated.
 
Saloon Keeper
Posts: 9742
80
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try changing the file from .jar to .zip and using standard zip utilities.
 
Ranch Hand
Posts: 171
Hibernate Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
probably you can find some clues here -

https://github.com/vermaanuragmaxima/wscreator/blob/adf0b5bab5f0a7768d4fd80ce72718c0aa36e1d5/src/main/java/com/maximaconsulting/webservices/WebServicesScanner.java
 
Marshal
Posts: 76887
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I always thought .jar files open with anything which can read .zip files.
 
Saloon Keeper
Posts: 26300
187
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unless someone has radically revised the JAR standard very recently, JAR files are ZIP files. The only difference is the additional META-INF data.

If a "jar -tvf xxxx.jar" hangs, my money is that the user's filesystem has locked on it. Either the JAR is "in use" in an exclusive way (???), or the user is having filesystem problems. A quick check would be to copy the JAR to a neutral directory and try to list the copy.

You can also try a dump of the file. The first 2 bytes of the file should be the letters "PK". As in PKZIP.
 
Kevin Simonson
Ranch Hand
Posts: 244
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:Unless someone has radically revised the JAR standard very recently, JAR files are ZIP files. The only difference is the additional META-INF data.

If a "jar -tvf xxxx.jar" hangs, my money is that the user's filesystem has locked on it. Either the JAR is "in use" in an exclusive way (???), or the user is having filesystem problems. A quick check would be to copy the JAR to a neutral directory and try to list the copy.

You can also try a dump of the file. The first 2 bytes of the file should be the letters "PK". As in PKZIP.


Turned out that the problem was that I was typing "jar -t -f j6plugin-0.2.jar" instead of "jar -tf j6plugin-0.2.jar". The latter worked just fine. My guess is that with the former it saw the "-t" all by itself and thought it needed to read the file from the standard input.
 
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic