This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes .WAR files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark ".WAR files" Watch ".WAR files" New topic
Author

.WAR files

sindhu
Greenhorn

Joined: Sep 12, 2005
Posts: 5
Hello there,

Can anyone plz tell me how to create .war files from class files.

I want to autodeploy .war files from sun application server 8.1

Thanks
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

From a command line at the root of your expanded WAR directory structure:

[ September 22, 2005: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 19059
    
  40

I see that I am not the only person who uses "jar" to create war files. My colleagues like to use "zip", because "jar" creates an extra manifest file and directory, that is not needed. Personally, it doesn't bother me.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1824

"sindhu"

Welcome to JavaRanch. We don't have many rules around here, but the one that we do have is our JavaRanch Naming Policy. Please take a moment to read it, and then please change your display name to comply. (We are looking for a first and last name.

Thank you very much,


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Manikanta Sabarish
Greenhorn

Joined: Jul 18, 2005
Posts: 14
I see that I am not the only person who uses "jar" to create war files. My colleagues like to use "zip", because "jar" creates an extra manifest file and directory, that is not needed. Personally, it doesn't bother me.


can we use "zip" files instead of "war"
then,do all servers support "zip" format.?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

No. But you can use zip to create wars.
Tom Blough
Ranch Hand

Joined: Jul 31, 2003
Posts: 263
Manikanta,

WARs and JARs are just zip files. You can create and view the contents of a ?ARs with any zip program. When you create a ?ar file using a zip program, just change the zip extension to the appropiate one.

As was previously pointed out, you need to add a manifest manually when building a JAR using a zip program.

Cheers,


Tom Blough<br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr>Cum catapultae proscriptae erunt tum soli proscripti catapultas habebunt.<hr></blockquote>
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
Originally posted by Henry Wong:
I see that I am not the only person who uses "jar" to create war files. My colleagues like to use "zip", because "jar" creates an extra manifest file and directory, that is not needed. Personally, it doesn't bother me.

Henry


Point your colleagues to the -M option.

-M do not create a manifest file for the entries

Better still, use Apache Ant.
If I could have a dollar for each time I've seen a EAR/WAR/JAR refuse to function because it was archived using some arbitrary tool...


Tony Morris
Java Q&A (FAQ, Trivia)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: .WAR files