Java 为什么没有将 WAR 文件导入 Eclipse 的选项?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3513284/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 01:25:29  来源:igfitidea点击:

Why no option to import a WAR file into Eclipse?

javaeclipseimportwar

提问by apfel

I have a WAR file for a Java project but when I try to import it into Eclipse, the only option is for archive files such as tar, zip, jar - nothing for war.

我有一个 Java 项目的 WAR 文件,但是当我尝试将其导入 Eclipse 时,唯一的选择是归档文件,例如 tar、zip、jar - 没有用于 war。

Is this only an option in certain editions of Eclipse because I have a copy of SpringSource (also Eclipse-base) that allows me to import WAR files?

这是否只是 Eclipse 某些版本中的一个选项,因为我有一个 SpringSource(也是 Eclipse-base)的副本,它允许我导入 WAR 文件?

Would it be possible to add this option to my current version without downloading a new edition of Eclipse?

是否可以在不下载新版本的 Eclipse 的情况下将此选项添加到我当前的版本中?

alt text

替代文字

采纳答案by Buhake Sindi

Your version of Eclipse is Eclipse IDE for Java Developers. Try download Eclipse IDE for Java EE developers

您的 Eclipse 版本是Eclipse IDE for Java Developers。尝试为 Java EE 开发人员下载Eclipse IDE

Your version of Eclipse doesn't have the Webtree pane.

您的 Eclipse 版本没有Web树窗格。

回答by CoolBeans

What version of eclipse do you have? I have 3.4 and 3.5 installed currently and both have this following path to import a war file.

你有什么版本的eclipse?我目前安装了 3.4 和 3.5,并且都具有以下导入War文件的路径。

Go to File->Import->Web->War.

转到文件->导入->Web->War。

回答by Aashutosh Shrivastava

If u still using Eclipse IDE for Java Developers so there is a alternate solution for it, it is not a good solution for developer but it work.

如果您仍在为 Java 开发人员使用 Eclipse IDE,因此有替代解决方案,这对开发人员来说不是一个好的解决方案,但它可以工作。

1.Unzip the war file.

1.解压war文件。

2.than create a project in eclipse.

2.然后在eclipse中创建一个项目。

3.Than copy the contain of unzip folder one by one & paste in proper position in your project.like servlet paste in src & jsp pages place in war folder.

3.然后将解压文件夹的内容一一复制并粘贴到您项目中的适当位置。例如将servlet粘贴在src和jsp页面中的war文件夹中。

4.care fully read this point an unzip folder there is a web-inf folder & also in your project there is web-inf folder. So copy the contain of web-inf folder carefully in project web-inf folder.

4.仔细阅读这一点,解压文件夹中有一个 web-inf 文件夹,并且在您的项目中也有 web-inf 文件夹。所以将 web-inf 文件夹的内容小心复制到项目 web-inf 文件夹中。

This solution perfectly work.

这个解决方案完美地工作。

回答by ashutosh.sr

Just install the Eclipse Web Dev tools from the Marketplace over the Eclipse for Java developers. No need to install IDE for Java EE developers.

只需为 Java 开发人员通过 Eclipse 从 Marketplace 安装 Eclipse Web Dev 工具。无需为 Java EE 开发人员安装 IDE。