Is there any software/script that will allow me to cd (change directories) into .jar/.ear/.zip files and edit the contents of the files it contains? I'm working on a large EJB project (yuck), and I frequently find myself in situations like the following:
something.ear/
|-- something.jar/
| `-- fileINeedToEdit.xml
I wo开发者_如何学JAVArk primarily via the command line (Mac/Linux), so I find myself decompressing the files with jar -xvf
, editing the file I need to edit, and then recompressing with jar -cvf
. Obviously, this becomes a major headache after the first few times.
I'd like to be able to treat the compressed files as directories, and simply cd
(or some alternate command) to the file I want to edit.
Does anyone know how I can accomplish this?
I agree with the comments to your question, an automated build should allow you to make this kind of changes easily and is the right way to go. But if you insist in this direction, check fuse-zip, it provides the ability for zip files to be mounted on any directory mount point.
There are two general strategies. Either use software that can mount the jars as pseudo file systems. That allows you to work exactly like you are used to, but I'm uncertain how well Mac OS supports user-space filesystems. Or use a tool that already has in-place editing support, like the Windows explorer or a more powerful editor (e.g. emacs).
I use one of this application If I want to check something in jar or ear file
- Krusader (file manager from KDE) - it allows to investigate jar, ear or war file, but unfortunatelly doesn't work well with nested jars files
- mc (Midnight Commander) - it works pretty well with ear, jar or war, event with nested jars
精彩评论