Wednesday, February 24, 2010

Creating jar (war) - Command

This sun link will he help us to understand the basics of creating a jar file and the commands involved.


When we open a directory in C drive, say folder name is myProject, and we have look of files in it.

c:>cd myProject;

We can see 2 things. A single dot (.) and a double dot (..) The single dot means its the current directory and double dot means parent directory.

c:\myProject> cd .

With this command, it is pointing to the current directory and nothing will happen.

c:\myProject> cd ..

With this command, it is pointing to the parent directory and it will move one level up and reach its parent directory.

c:\>

With that understanding we can now look at creating a war file.

Web projects are packaged as war while EJB projects are packaged as ear.

Web Project = myProject.war
EJB Project = myProject.ear

c:\myProject\webProject\Webcontent\jar -cvf oce.war .

jar command

c = create
v = verbose (like logger, which prints all the details on the command prompt)
f = File name (Here all the files will packed under the name we give, ex: oce.war)
dot (.) = This dot means, pack everything under this folder.

There is one important thing we should note here. We should pack (creating .war file) things within the "Webcontent" folder rather "WebProject" folder.

0 Comments:

Post a Comment

<< Home

CONTACT

p> You can reach me @ My EMail ID

Powered by Blogger