Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to make a war file

 
samdeep aarzoo
Ranch Hand
Posts: 160
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone please tell me how to make
a war file?
 
Tom Henner
Greenhorn
Posts: 18
 
samdeep aarzoo
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if possible can anyone explain me a
little how to make a war file thanks
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15214
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's wrong with the tutorial that Tom provided a link to?
 
Chao Garreson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just name your file name with extension .war
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sowjanya Chowdary
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry i forgot to mention :
you have to type "jar -cvf pets.war *" at command line.
 
gino jersey
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put C:\JBuilderX\jdk1.4\bin in your PATH.
 
shoeb sayyed
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i did jar-cvf -MyWar.war home.html WEB-INF;

it is not getting deployed on weblogic

how do it do it?
 
Campbell Ritchie
Sheriff
Posts: 48645
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a space after "jar"? Read this FAQ please.
 
shoeb sayyed
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20510
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
akbar saleem
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48645
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Are you sure he is still trying to make that war file?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic