Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating war file with jar command is not working properly

Tags:

java

war

jetty

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.

like image 328
Kamalam Avatar asked Jan 17 '23 15:01

Kamalam


2 Answers

"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.

like image 73
eis Avatar answered Jan 19 '23 06:01

eis


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 .

like image 31
jovaini Avatar answered Jan 19 '23 04:01

jovaini