Link to home
Start Free TrialLog in
Avatar of jazzIIIlove
jazzIIIloveFlag for Sweden

asked on

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.
ASKER CERTIFIED SOLUTION
Avatar of zzynx
zzynx
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanx 4 axxepting
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

Avatar of jazzIIIlove

ASKER

Cehj comment is also valid. Wanna reopen Cehj?
Don't worry about it