Created
September 28, 2015 21:32
-
-
Save NLKNguyen/7d90fb15b088d3e48f1a to your computer and use it in GitHub Desktop.
Revisions
-
NLKNguyen created this gist
Sep 28, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ *From `Professional Java for Web Applications` page 24* ## Configure Tomcat for first use ### Add user In file: $TOMCAT_HOME/conf/tomcat-users.xml Add in between `<tomcat-users>` and `</tomcat-users>` ```XML <user username="admin" password="admin" roles="manager-gui,admin-gui" /> ``` ## Add support for Java SE 8 In file: $TOMCAT_HOME/conf/web.xml Search for `org.apache.jasper.servlet.JspServlet` Below the existing `<init-param>` and `</init-param>`, add the following ```XML <init-param> <param-name>compilerSourceVM</param-name> <param-value>1.8</param-value> </init-param> <init-param> <param-name>compilerTargetVM</param-name> <param-value>1.8</param-value> </init-param> ``` ### Make sure JAVA_HOME variable is set Try this to see if it points to java jdk ``` In Windows: > echo %JAVA_HOME% ``` Otherwise, set the system environment variable, for example ``` JAVA_HOME C:\Program Files\Java\jdk1.8.0_60 ``` ### Test ``` > cd C:\Program Files\Apache Software Foundation\Tomcat 8.0\ > bin\startup.bat ``` If everything is ok, `localhost:8080` will show the Apache Tomcat page