To set up Eclipse for Java and web development, follow these steps:
-
Make sure you have Eclipse IDE for Java and Web Developers installed.
-
Check the port configuration in the Apache folder (if it's set to 8080 as default, it might not work).
Navigate to the Apache folder -> conf -> server.xml
Locate the <Connector port="8001" line (approximately line 69) and change the port to something other than 8080 (in this case, it's set to 8001):
-
Configure the server in Eclipse:
Go to Window -> Preferences -> Server -> Runtime Environments. Click "Add" and choose "Apache" -> "Apache Tomcat v9.0" -> "Next". Browse to the location of your Apache folder and click "Finish".
-
Verify the JRE System Library configuration:
Right-click on your project -> Build Path -> Configure Build Path. In the "Java Build Path" window, go to "Order and Export". Check if there is a [unbound] entry next to "JRE System Library". If it's unbound, click on the "Libraries" tab and click "Add Library". Select "JRE System Library" and choose the desired JRE version.
-
Running your project:
Right-click on your project -> Run as -> Run on Server.