纵有疾风起
人生不言弃

IntelliJ idea 引入eclipse myeclipse 开发的web项目 idea配置tomcat

最近需要维护一些myeclipse开的旧的web项目,但是本人一直用IntelliJ idea 开发web项目。所以就想办法把myecpise开发的项目导入idea中,这样我们就可以直接用idea改造旧代码了。下面旧来教大家如何将myeclipse或者ecplise开发的javaweb项目导入到idea中。

一,需要把eclipse开发的项目中无关文件删除

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图

如上图,我们只需要保留src和webroot即可,其余的都要删除。删除后如下

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图1

二,导入源码到idea

1,点击open,选择上面第一步的源码

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图2
image.png

如果你已经打开idea,就用这个opend

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图3

然后等加载,加载完成后会有如下弹窗。

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图4

点击弹窗,做默认配置,点ok即可

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图5

三,修改配置

1,进入idea配置页

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图6

2,配置jdk

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图7
image.png

3.配置Modules

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图8

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图9

点完上图的add,选择你的项目根目录

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图10

添加jar包,操作如下

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图11

选择WebRoot—–>WEB-INF—->lib

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图12

导入后,如下,选中,这样就可以成功导入jar包了

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图13
image.png

4,添加Artifacts

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图14

选中我们的项目news,点ok即可

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图15

添加成功后如下

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图16

四,配置tomcat

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图17

所有的都默认即可,只需要点击fix

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图18

点完fix,出现下图,把application context改为我们的项目名称即可

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图19

到这里tomcat也配置完了。

五,配置tomcat编译输出路径

1,在我们项目目录下创建一个空文件夹 out

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图20

然后在我们第三步配置里,配置输出路径为我们这个out

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图21

这样点击运行,就可以启动我们的web项目了

IntelliJ idea 引入eclipse myeclipse 开发的web项目  idea配置tomcat插图22

文章转载于:https://www.jianshu.com/p/13e587c1b097

原著是一个有趣的人,若有侵权,请通知删除

未经允许不得转载:起风网 » IntelliJ idea 引入eclipse myeclipse 开发的web项目 idea配置tomcat
分享到: 生成海报

评论 抢沙发

评论前必须登录!

立即登录