some kind of urgent war file replacing a file.

Hi;

I have a war file and i can see the contents as follows:

C:\Program Files\Java\jdk1.6.0_45\bin>jar -tvf "C:\mywar.war"

and i want to replace an existing file in this war without a hassle:

C:\Program Files\Java\jdk1.6.0_45\bin>jar -uf C:\mywar.war WEB-INF/test.txt

Above command fails even there is a WEB-INF folder, and i need that file to be in WEB-INF.

C:\Program Files\Java\jdk1.6.0_45\bin>jar -uf C:\mywar.war test.txt
This works but it's putting on top level. It should be one level down in WEB-INF.

What to do?

Regards.
LVL 12
jazzIIIloveAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zzynxSoftware engineerCommented:
You can manipulate the content of a jar file with WinRar
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
zzynxSoftware engineerCommented:
Thanx 4 axxepting
0
CEHJCommented:
C:\Program Files\Java\jdk1.6.0_45\bin>jar -uf C:\mywar.war WEB-INF/test.txt

Open in new window


Firstly, your jdk is way out of date. If the wrong kind of code gets to use its JRE, you could be in serious trouble from a security point of view
Secondly, don't work from the bin directory - that should be in PATH
Thirdly you shouldn't really be working in a system root either

Above command fails even there is a WEB-INF folder, and i need that file to be in WEB-INF.
It should be
jar -uf C:\mywar.war WEB-INF\test.txt

Open in new window

0
jazzIIIloveAuthor Commented:
Cehj comment is also valid. Wanna reopen Cehj?
0
CEHJCommented:
Don't worry about it
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.