Download and install tomcat 9 https://tomcat.apache.org/download-90.cgi Unpack and place in / Applications / tomcat
/Applications/tomcat/apache-tomcat-9.0.14
eclipse official website https://www.eclipse.org/downloads/packages/release/2018-12/r Download Mac Cocoa 64-bit from Eclipse IDE for Java Developers After unpacking, move to Application folder
Search by "tomcat" from [Help]-[Eclisep Marketplace] Install Eclipse Tomcat Plugin 9.1.3
Set the Tomcat version and installation directory from [Preferences]-[tomcat]
First check if the plugin is working Try starting and stopping tomcat from the eclipse menu
After launching, make sure you can see the tomcat sample page at http: // localhost: 8080
Try creating a tomcat project
Create with an appropriate name from [File]-[New]-[Project]-[Tomcat project]
After creating, make sure that the configuration file for localhost is created in the conf folder.
Create index.jsp directly under the project
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="java.util.Calendar"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%
Calendar calendar = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
String today = "ToDay" + sdf.format(calendar.getTime()) + "is";
%>
<%=today%>
Access from a browser and check
Also make sure you can create a class or Servlet to do a Tomcat hot deploy
Recommended Posts