很多初学者可能都遇到过这样的问题,有时候从网上下载的项目是myeclipse环境开发的,但是自己的电脑只装了eclipse,那么如何把eclipse项目如何导入myeclipse项目中呢?下面来看看吧。

1.将web项目手动拷贝到Eclipse的工作空间下

我将要导入的项目-yyproject_jk,当前位置保存在桌面上; Eclipse工作空间的路径为:D:\WorkSpaces\eclipse2016; 将项目拷贝到Eclipse的工作空间下 2.打开Eclipse-->右键-->Import-->选择"从工作空间中导入"(Existing Projects into Workspace)

-->Next-->Browse-->弹出Eclipse的工作空间根目录

-->将其展开,找到名称为yyproject_jk的文件夹-->确定-->取消勾选项"Copy projects into workspace"-->Finish即可。

在导入项目之后,大家会发现,项目报错了,会出现红x,或者出现一个红色的感叹号,不要急,现在项目是没有问题的,只是项目环境没有配置好。

选中项目-->右键-->Build Path-->Configure Build Path

左侧选中"Java Build Path" -->Libraries

改jdk:如果提示jdk版本不一致,则需要将jdk改成自己的jdk,方法:选中-->右侧"Edit"-->切换成自己的jdk即可;

删掉MyEclipse的配置项:即第二个红框,方法:选中-->右侧"Remove"即可; 添加tomcat服务器:右侧选择"Add Library..."-->选择"Server Runtime"-->Next-->选择一个要运行的"server"-->Finish即可。

然后,点击"Apply"-->OK即可

现在基本项目都不会报错了,不知道大家学会了没有。