The thing is …I am not able to understand the line…”If the .class file is part of a Jar file, you can place the new version of the Jar file directly in application_root/module_name/WEB-INF/lib.”
In Example.war file ,the WEB-INF/lib contains only three jar files(mysql-connector-java-5.0.7.jar,dmtpserv.jar,mail.jar)How can I replace the existing .jar files with new version.please help me if you any thing about it..
thanks in advance.
jar uf jar-file input-file(s)
I work mostly in Unix/Linux environments, so I always use jar instead of zip.
Take a look at this: Update Jar File
I did also notice this waring about using zip:
JAR files are built on the ZIP file format. Computer users can create or extract JAR files using the jar command that comes with a JDK. They can also use zip tools to do so; however, caution should be exercised as to the order of entries in the zip file headers as the manifest likely needs to be first.
Ref: Wikipedia - Jar File
Ant also has a Jar Task, but I have never used it for just doing a simple update.
Thanks a lot for your reply..
By using the cmd:jar uf track.war UserInfo.class
I can update the .class file to the .war file.but i need to add this .class file to web-inf\classes\org\opengts\war\track\page folder in .war file.I used -C optiopn to change the directory.Both the .war file and .class file are at same folder.Below error is coming when i run the jar cmd.
C:\Documents and Settings\Administrator\Desktop\keerthana\mydoc\new changes\18-5
-2011>jar uf track.war -C WEB-INF\classes\org\opengts\war\track\pages\ UserInfo
WEB-INF\classes\org\opengts\war\track\pages\UserInfo$FirstLogin.class : no such
file or directory
Then put "UserInfo.class" AND IT'S COMPILED INNER CLASS "FirstLogin.class" in the "WEB-INF/classes/org/opengts/war/track/pages/" directory.
Question: Is it "track/page" OR is it "track/pages"?
Then jar -uf track.war WEB-INF/classes/org/opengts/war/track/pages/UserInfo.class
Check to see if all of your class files are in the right place by using "jar -tf track.war".