使用 jar 命令将 war 解压到一个目录。这可能吗?

发布于 2024-10-04 08:26:41 字数 278 浏览 0 评论 0原文

我在网上搜索了一种将 war 文件从一个位置解压到另一个位置的方法,但到目前为止还没有令人满意的结果。 我使用这个命令

jar -xvf mysite.war -C /usr/local/tomcat/webapps/mysite/

它不起作用。this:

jar -xvf mysite.war /usr/local/tomcat/webapps/mysite/

没有抛出任何错误但仍然不起作用任何想法?

I've search online a way to unpack a war file from a location to a different one, and so far nothing satisfactory.
i use this command

jar -xvf mysite.war -C /usr/local/tomcat/webapps/mysite/

it's not working.this :

jar -xvf mysite.war /usr/local/tomcat/webapps/mysite/

is not throwing any error but still not working any idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冬天旳寂寞 2024-10-11 08:26:42

在 mkyong.com 上找到了 博客文章

如所述: “...jar 确实没有选项直接将文件提取到另一个文件夹...” 因此,您需要做的是更改为要提取到的目录,然后引用 jar 文件 这在

mkdir newdir
cd newdir
jar -xvf /workspace/test/classes/test.jar

Windows 上也能解决问题,因为默认情况下解压缩在那里不可用。

Found the blog post at mkyong.com

As stated there: "...jar does doesn’t has option to extract files to another folder directly..." So what you need to do is change to the directory you want to extract to, and then refer the jar-file from there

mkdir newdir
cd newdir
jar -xvf /workspace/test/classes/test.jar

This will do the trick for you on Windows as well, since unzip is not available there by default.

白云不回头 2024-10-11 08:26:42

war 文件是一个压缩存档。也许使用unzip会起作用。

A war file is a zipped archive. Perhaps using unzip will work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文