Eclipse配置Tomcat服务器和Dynamic Web Project的问题
在eclipse配置tomcat的时候,我发现在Eclipse---Preferences---server---Runtime Environment中,点击“Add”按钮,里面看不到tomcat的,只有个“J2EE Runtime Library”。
解决办法:
- Help -> Install New Software
- Choose "Luna - http://download.eclipse.org/releases/Luna" site
- Expand "Web, XML, and Java EE Development"
- Check JST Server Adapters (version 3.2.2) and JST Server Adapters Extentions
如果原生的Eclipse没有Dynamic Web Project, 需要安装以下plugin. The list is:
- Eclipse Java EE Developer Tools
- Eclipse Java Web Developer Tools
- Eclipse Web Developer Tools
- Eclipse XML Editors and Tools
Apache Tomcat的设置
Setting the JAVA_HOME
, CATALINA_HOME
Environment Variable on Windows
One can do using command prompt:
set JAVA_HOME=C:\ "top level directory of your java install"
set CATALINA_HOME=C:\ "top level directory of your Tomcat install"
set PATH=%PATH%;%JAVA_HOME%\bin;%CATALINA_HOME%\bin
OR you can do the same:
- Go to system properties
- Go to environment variables and add a new variable with the name
JAVA_HOME
and provide variable value asC:\ "top level directory of your java install"
- Go to environment variables and add a new variable with the name
CATALINA_HOME
and provide variable value asC:\ "top level directory of your Tomcat install"
- In path variable add a new variable value as
;%CATALINA_HOME%\bin;
Tips
1. 安装时一定要以管理员权限安装,否则以后会有权限的麻烦。
2. 如果在运行时出现Catalina.log <access denied>的error,可以通过修改Top level tomcat directory权限的方法使用户获得读写权限,进而解决问题。