Repacking a file inside a java archive with nested .jars

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Repacking a file inside a java archive with nested .jars
# 1  
Old 05-03-2011
Repacking a file inside a java archive with nested .jars

Hello,

I need to repack a file inside several java archives (nested .jar files) with or without overwrite.

I am using a manual approach with mc, but it's painfully slow progress.

For example I want to refresh a file deep inside a java archive (with nested .jar files):

I have a java archive structured like this:

/home/jboss/
file1.ear which contains a 2nd archive file2.jar and inside a 3rd archive + subdirs file3.jar/Report/Web

I want to copy
and repack
Code:
myfile.class

inside that file
Code:
/home/jboss/file1.ear\file2.jar\file3.jar/Report/Web



I want to know if it's possible to write a shell script/command in RHEL 5 to resolve this problem efficiently ?

Many thanks.



---------- Post updated at 05:55 PM ---------- Previous update was at 04:53 PM ----------

I was able to repack (with $JAVA_HOME/bin/jar) a file into my archive, but only in root.

Code:
[jboss@srv ~]$ jar uvfM /home/jboss/file1.ear myfile.class
adding: file.class(in = 2405) (out= 1291)(deflated 46%)

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Cpio - input files (from list) are stored in different order inside cpio archive - why?

Due to budget constraints I have to reinvent an Enterprise backup system in a SPARC (sun4v) Solaris estate (10 & 11). (yep - reinvent wheel, fun but time consuming. Is this wise?! :confused: ) For each filesystem of interest, to try to capture a 'catalog' at the front of each cpio archive (for... (1 Reply)
Discussion started by: am115998
1 Replies

2. Shell Programming and Scripting

Script to archive logs and sftp to another archive server

Requirement: Under fuse application we have placeholders called containers; Every container has their logs under: <container1>/data/log/fuse.log <container1>/data/log/fuse.log.1 <container1>/data/log/fuse.log.XX <container2>/data/log/fuse.log... (6 Replies)
Discussion started by: Arjun Goswami
6 Replies

3. Shell Programming and Scripting

Error with nested if within an sqlplus task inside

Hi ALL, I am receving a "strange" error using a nested if within an sql operation inside: ./dom.ksh: syntax error at line 80 : `then' unmatched This is all my script code: in bold the step receiving the error. Any help would really aprrecieted ......! **** I have tried all the... (2 Replies)
Discussion started by: AndreaCecco
2 Replies

4. Programming

Finding a way to load appropriate jars in different OSs as per requirement.

Hi All, This discussion involves getting a way to load different jars in different Operating Systems. Case Scenario --------------- I am working on a specific OS known as NSK. Its an unix flavour and powers the HP NSK Servers. I am running one of my middleware app ( a java application) on... (3 Replies)
Discussion started by: Pabi
3 Replies

5. AIX

Any file to differentiate JAVA JRE and JAVA JDK

Folks, Any idea of where can I find a specific file to differentiate JRE and Java JDK installed on AIX platform :cool: (3 Replies)
Discussion started by: dellcisco
3 Replies

6. Shell Programming and Scripting

Nested case inside awk

please let me know if the below code could be written efficiently inside single awk case "$INP" in ksh) cat catalog | awk 'BEGIN {FS=",";} { print $2 } END {}' ;; pset) cat catalog | awk 'BEGIN {FS=",";} { print $3 } END {}' ;; dml) cat catalog | awk 'BEGIN {FS=",";} {... (2 Replies)
Discussion started by: cvsanthosh
2 Replies

7. UNIX for Dummies Questions & Answers

Find a file in group of jars

Hi, jar -tvf tools.jar | grep LinkInfoImpl Output: 4968 Fri Feb 22 02:34:52 EST 2008 com/sun/tools/doclets/formats/html/LinkInfoImpl.class However, i need the similar output for all jar files under /apps/lib/ directory and its subdirectories. Can you please help format my command to... (3 Replies)
Discussion started by: mohtashims
3 Replies

8. Shell Programming and Scripting

nested double quota and white space inside variable

I have a question about nested double quotes. Any help is appreciated. Here are my commands on Mac OS. # string="Ethernet \"USB Ethernet\" \"Bluetooth DUN\" AirPort FireWire \"Bluetooth PAN\"" # echo $string Ethernet "USB Ethernet" "Bluetooth DUN" AirPort FireWire "Bluetooth PAN" #... (3 Replies)
Discussion started by: lindazhou
3 Replies

9. AIX

checking the version revisions of a java file inside the ear using KSHELL in AIX.

consider on day1, in PVCS repository we have java files like a.java,b.java with version revision 1.0, through ANT build script we have compiled and created an ear,named c.ear in AIX build server.we have transfered this ear from build server to portal server through FTP using KSHELL. consider... (0 Replies)
Discussion started by: kareemaashik
0 Replies
Login or Register to Ask a Question