7
1
On an Amazon Linux instance I'm trying to edit a jar file remotely through putty. vim
provides a convenient navigator, which displays a prompt with a list of the contained files in the jar:
> vim filename.jar
" zip.vim version v22
" Browsing zipfile /home/ec2-user/tigase/libs/tigase-muc.jar
" Select a file with cursor and press ENTER
453 01-14-2013 10:01 META-INF/MANIFEST.MF
110 01-14-2013 10:01 META-INF/maven/tigase/tigase-muc/pom.properties
4675 01-14-2013 10:01 META-INF/maven/tigase/tigase-muc/pom.xml
5751 01-14-2013 10:01 tigase/component/AbstractComponent.class
2337 01-14-2013 10:01 tigase/component/AbstractComponent$1.class
....
However after selecting a file (eg. AbstractComponent.class) and press Enter, within vim I get:
caution: filename not matched: 5751 01-14-2013 10:01 tigase/component/AbstractComponent.class
and the file doesn't open.
As a side note, I also noticed that if I extract the jar (either with unzip
or jar
) and open an extracted file with vim, the contents are misformatted:
Êþº¾^@^@^@2^A^[^H^@ ^H^@
^H^@^K^H^@^U^H^@^V^H^@!^H^@#^H^@^^A^@) stanza already with type='...
^A^@^C()I^A^@^C()V^A^@^C()Z^A^@^F<init>^A^@^NDEFAULT_WRITER^A^@^WFE...
....
Any ideas how to overcome the error or formatting issue?
2You are aware that jar is basically a zip, and that .class files are Java bytecode files? Meaning they're not text files, but inly data containers and you'd need a decompiled (or a hex editor and a steady eye) to read them. – Bobby – 2014-02-05T10:04:16.433