简体   繁体   English

使用jar命令创建war文件无法正常工作

[英]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. 大家好我已经使用以下命令从我的spring项目生成war文件。

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. war文件正在生成但是当我使用jettyrunner.jar部署它时,它没有部署。我在war文件中注意到WEB-INF \\ class文件夹中没有生成类文件。任何人都建议我一个解决方案对于这个问题。

"jar" command will not create .class files, it is for creating the package. “jar”命令不会创建.class文件,而是用于创建包。 So you have to compile the source files first, then use the jar command. 所以你必须先编译源文件,然后使用jar命令。

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. 添加所有文件。

How To Create i.war in Java 如何在Java中创建i.war

1.Install Jdk 1.安装Jdk

2.Set JAVA_HOME in Inviroment 2.在Inviroment中设置JAVA_HOME

3.cmd = > 3.cmd =>

4. c:\\user\u0026gt; Cd D:\\apex_listener 4. c:\\user\u0026gt; Cd D:\\apex_listener

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM