Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What is a most convenient way to see the content of .jar file w/o using unzip/untar commands? What I'd like to do - is to browsing inside using cd command like it is the usual folder, seeing content, size of classes - 'ls -la'.

MC allowed to do so on the fly. Is there are any ease-in-use alternative?

share|improve this question
    
    
@ekaj less and unzip doesnt help me - it doesn't show me the size of files in the archive for example, or date&time of last modification (unless I'll decompress it somewhere to /tmp/AAA and then will run ls -la against /tmp/AAA - which is what I want to avoid). –  javagirl May 1 '12 at 17:20
    
Don't unzip the .zip file, just open it. You can see the sizes and modification dates. –  ekaj May 2 '12 at 12:06
    
how can I open it in the linux server command line? –  javagirl May 3 '12 at 15:34
    
@javagirl: unzip -l does show you the size of files in the archive and date & time of last modification without unpacking the package. See my answer below. Actually, this is a duplicate as ekaj suggested. –  DevSolar Jun 19 '12 at 11:53
add comment

5 Answers

Use the jar tool that comes with the Java SDK for listing contents of a jar file. As described in http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jar.html

$ jar tvf jarfile.jar
share|improve this answer
add comment

I think .jar files are basically .zip files. So, I guess, fuse-zip could work.

share|improve this answer
    
This is the answer I would go with if you actually want to navigate to the .zip archive like a folder. (or at least that is how I understood that it works) –  ekaj Apr 27 '12 at 20:00
    
I can't install additional stuff to server, unless I wouldn't ask this question just by installing MC –  javagirl Apr 30 '12 at 9:29
add comment

Just rename the .jar file to a .zip. IE, test.jar to test.zip. You will be able to see all of the compiled classes. If you want to view the source its self, however, you will need a decompiler.

share|improve this answer
    
sorry, i didn't get it. what is the difference? i still cannot do ls, cd command against *.zip file. –  javagirl May 1 '12 at 17:16
    
@javagirl You can only open .zip files, as far as I know, by clicking on them if you are not going to install any additional software. IE, you aren't going to cd to them because they are not directories. –  ekaj May 2 '12 at 12:06
    
if you'd use 'mc' in linux you would knew that you can browse over content of zip/jar file, because it makes unzipping on fly. My question was about the alternative to 'mc', because I heard a lot of linux guru saying they can avoid 'mc' and use pure command line with the same result and efficiency. And I cannot 'clicking' on zip file as far as I'm on the linux server command line –  javagirl May 3 '12 at 15:34
    
Well, this is an alternative. –  ekaj May 3 '12 at 16:05
add comment

This one was always enough for me:

unzip -l <jarfile>

share|improve this answer
add comment

You could use an ssh mount to have server's file system locally. After it you can use any locally available software to navigate the file system, e.g. Far Manager is very powerful to navigate into archives.

In this solution you don't need any additional software on the server, only sshd.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.