File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

view content of file in a jar file

 
Herbert Wilson
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is there a way to view the content of a file that is in a jar file. I can get a list of the files in a jar file by 'jar -tvf name.jar', but is there a way to view the content of a particular file without extracting the jar file.
 
Joel McNary
Bartender
Posts: 1824
Eclipse IDE Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A jar file is juat a ZIP file. You can open it with any .ZIP utility (such as WinZIP if you're on a Windows platform), and (if the utility lets you -- WinZIP does), view the files there.
 
Herbert Wilson
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Joel. Is there an UNIX utility that lets u view the content of the file?
 
Loren Rosen
Ranch Hand
Posts: 156
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On unix/linux you can do the following, to extract foo.java from name.jar:
jar xf foo.java < name.jar
That will write foo.java to stdout.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic