[摘要]eclipse导入web项目图文教程:1、将项目根目录导入File->Import->General->Existing Projects into Workspace2、对Web...
eclipse导入web项目图文教程:
1、将项目根目录导入
File->Import->General->Existing Projects into Workspace
2、对Web-INF->lib下的jar表进行 Build Path->Add to Build Path操作
成功后可以在Java Resources->Libraries中找到,也可以在Java Resources->Libraries->Web App Libraries中找到
BuildPath->Java Build Path->Libraries下Add External JARs
c3p0-0.9.1.2.jarcommons-dbutils-1.3.jarmysql-connector-java-5.1.39-bin.jar
3、添加servlet-api.jar包,其路径在下

4、导入java web项目出现JRE System Library(unbound)和Server Library(unbound)解决方法
选中后Edit,将其改为合适的版本


5、修改连接数据库配置文件,其路径在/src/c3p0-config.xml

附:
1、有时候将web工程导入eclipse中,会变为一般的java工程,那样就无法部署至web服务器中。以下方法可以将java工程转化为web工程:
在Eclipse里选中工程-->右键-->properties-->Project Facets 选中“Dynamic Web Module”、和"Java"两项,然后点Apply--->Save ,最后刷新项目就变成了Web工程了!
2、有时候会出现dynamic web module 3.0 requires java 1.6 or newer错误,需要把 选中工程-->右键-->properties--》Java Compiler修改成1.6编译,就可以了。
3、在RunOnServer时候提示 “The selection cannot be run on any server.”

做两处修改
(1)在项目上右键->Properties 在Project Facets中勾选Dynamic Web Module和Java,如果已经勾选,查看这两项当前使用的版本是否正确(如果没有记住应该使用的版本,可以查看自己创建的Dynamic Web Project中用同样的方法查看其对应版本)
(2)在项目上右键->Properties 选择Server 发现当前选择的服务器为,选择下面的Tomcat v8.0 Server at localhost

学习教程快速掌握从入门到精通的电脑知识
关键词:eclipse怎样导入web项目 eclipse导入web项目图文详细教程