File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes how to make a war file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to make a war file" Watch "how to make a war file" New topic
Author

how to make a war file

samdeep aarzoo
Ranch Hand

Joined: Jun 09, 2005
Posts: 160
can anyone please tell me how to make
a war file?
Tom Henner
Greenhorn

Joined: Jul 04, 2005
Posts: 18
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/WebComponents3.html

has a tutorial.
samdeep aarzoo
Ranch Hand

Joined: Jun 09, 2005
Posts: 160
if possible can anyone explain me a
little how to make a war file thanks
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

What's wrong with the tutorial that Tom provided a link to?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Chao Garreson
Greenhorn

Joined: Aug 24, 2005
Posts: 6
just name your file name with extension .war
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41112
    
  45
Ant can create a war file for you; here is the relevant excerpt from the Ant manual.

just name your file name with extension .war


It is customary to append a " " to a post like this, so other people know you're joking.


Ping & DNS - my free Android networking tools app
Sowjanya Chowdary
Ranch Hand

Joined: Aug 22, 2005
Posts: 35
go to the folder in which you have files to include in .war.
type-> jar -cvf pets.war *
Which means, "compress everything in this directory into a file named pets.war"
(c=create, v=verbose, f=file)

Or
If u want only some files, specify file names separated with ,(comma) in place of '*'.
Sowjanya Chowdary
Ranch Hand

Joined: Aug 22, 2005
Posts: 35
sorry i forgot to mention :
you have to type "jar -cvf pets.war *" at command line.
gino jersey
Greenhorn

Joined: May 24, 2005
Posts: 21
i tried what you said:
"jar -cvf myWar.war"

but i got a message saying command" jar is unrecognized.
what am i missing?

my jar command is in C:\JBuilderX\jdk1.4\bin

but files and folders i want to archive are in:
C:\apimswebapps\apimsprdCTC007

what should i do?
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Put C:\JBuilderX\jdk1.4\bin in your PATH.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
shoeb sayyed
Ranch Hand

Joined: Mar 14, 2010
Posts: 48
i did jar-cvf -MyWar.war home.html WEB-INF;

it is not getting deployed on weblogic

how do it do it?


Thanks,
Shoeb
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38007
    
  22
Is there a space after "jar"? Read this FAQ please.
shoeb sayyed
Ranch Hand

Joined: Mar 14, 2010
Posts: 48
I am really sorry.

There is a space

it is jar -cvf myWar.war home.html WEB-INF;

I am not able to deploy my war file after this?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19653
    
  18

That only created the WAR file. You must then upload it into Weblogic. I can't help you on that though; I use Tomcat myself.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
akbar saleem
Greenhorn

Joined: Oct 30, 2012
Posts: 1
prepare the war file :


suppose your deployment directory is "VoterApp" that is present in "d:\" then you go to that location from command prompt. After you type the below given....


d:\VoterApp>jar cf VoterApp.war .


here
c--->create war file
f---->specify the war file name
. --->dot represents the current directory.It tells us take everything of current directory and create war file of that aplication.
another precation is that you must give space between VoterApp.war and .(dot).
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38007
    
  22
Welcome to the Ranch

Are you sure he is still trying to make that war file?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to make a war file
 
Similar Threads
servlets
What is a .war file?
Request for JSP Samples
WAR file
how to make a .war file