Kamalam
Kamalam

Reputation: 1254

Creating war file with jar command is not working properly

Hi all i have used the following command to generate war file from my spring project.

D:\projectsample\webContent>jar cvf projectsample.war

The war file is generating but when i deploying it using the jettyrunner.jar,its not deploying.I have noticed in the war file that there is no class files are generating inside the WEB-INF\class folder.Can anyone suggest me a solution for this problem.

Upvotes: 4

Views: 24200

Answers (2)

jovaini
jovaini

Reputation: 11

How To Create i.war in Java

1.Install Jdk

2.Set JAVA_HOME in Inviroment

3.cmd = >

4.c:\user> Cd D:\apex_listener

5.D:\apex_listener> jar -cvf0 D:\apex_listener\i.war -C Y:\APPLICATION_EXPERESS\apex_4.2.2_en\apex\images .

Upvotes: 1

eis
eis

Reputation: 53462

"jar" command will not create .class files, it is for creating the package. So you have to compile the source files first, then use the jar command.

Also, you might need to add as parameter(s) the files you want to include, so something like

jar cvf myapp.war *

To add all files.

Upvotes: 8

Related Questions