Creating a simple Java Servlet (Web Server Page) with Apache Maven on Microsoft Windows

JK JK 2030 
Created at  
7,203 0 0

STEP 1. Install OpenJDK 17

https://learn.microsoft.com/en-us/java/openjdk/download#openjdk-17 → select microsoft-jdk-17.0.10-windows-x64.msi → Install

 

STEP 2. Install Maven

  1. https://maven.apache.org/ → Download → apache-maven-3.9.6-bin.zip (or latest version) → unzip and move to C:/Program Files → You should remember the path like C:\Program Files\apache-maven-3.9.6 
  2. Now click on Start Menu and search “Edit the system environment variables” and open it → Advanced → Click New under User variables → Set variable like:
    Creating a simple Java Servlet (Web Server Page) with Apache Maven on Microsoft Windows
    Then you will see the result like below:
    Creating a simple Java Servlet (Web Server Page) with Apache Maven on Microsoft Windows
  3. Add MAVEN_HOME Directory in PATH Variable by adding \bin in the last as below
    Creating a simple Java Servlet (Web Server Page) with Apache Maven on Microsoft Windows
  4. Verify if maven is correctly installed: Start → cmd + Enter → run mvn -version 
C:\Users\kurap>mvn -version
Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)
Maven home: C:\Program Files\apache-maven-3.9.6
Java version: 17.0.10, vendor: Microsoft, runtime: C:\Program Files\Microsoft\jdk-17.0.10.7-hotspot
Default locale: en_US, platform encoding: MS949
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"

 

STEP 3. Creating a Java Web project in VS Code by using Maven plugin

If you haven't install “Java Extension Pack”, do below steps

Run VS Code → File → Preferences → Extensions (Ctrl + Shift + X) → Type Project Manager for Java→ Install Project Manager for Java → Install

Run VS Code → File → Preferences → Extensions (Ctrl + Shift + X) → Type Extension Pack for Java→ Install Extension Pack for Java → Install

Run VS Code → File → Preferences → Extensions (Ctrl + Shift + X) → Type JSP Language Support→ Install JSP Language Support → Install

If you haven't install “Maven for Java”, do below steps

Run VS Code → File → Preferences → Extensions (Ctrl + Shift + X) → Type maven → Install Maven for Java → Install

Creating a simple Java Servlet (Web Server Page) with Apache Maven on Microsoft Windows

 

STEP 4. Create a Maven Project

Create a Maven Project → maven-archetype-webapp → 1.4 → input group ID like com.foodbank  → input project name like ca_foodbank → create directory and Select Destination Folder 

Creating a simple Java Servlet (Web Server Page) with Apache Maven on Microsoft Windows

As a result, ca_foodbank  will be created with the necessary files

 

Refernce:

 

STEP 5. How to run web service

https://tomcap.apache.org → Tomcat 10 → 32-bit/64-bit Windows Service Installer → Next → I Agree → + Host Manager + Examples → Set HTTP/1.1 Connector Port as 8080, Admin User Name (usually admin), Password → Next → Select Java Path (Usually installed under C:\Program Files\Microsoft\) → Next → Finish

Regarding Java Path, today I installed at C:\Program Files\Microsoft\jdk-17.0.10.7-hotspot based on the STEP 1

You can check your web server at https://127.0.0.1:8080 if everything goes fine.

 

 

STEP 6. JSP/Servlet Tutorial

Tags Apache Tomcat 10 JSP Java Tomcat Facebook X
Comments 0
Similar posts
  1. Java Servlet Example
    7,145
  2. Java Tutorials associated with AP Computer Science A
    7,684
  3. Difference between Java and Javascript
    7,672
  4. Machine Learning Types and Programming Languages
    7,280
  5. Java Inner Classes
    7,090
  6. Java Polymorphism
    7,078
  7. Java Inheritance (Subclass and Superclass)
    7,198
  8. Java Packages
    7,202
  9. Java Classes and Objects
    7,129
  10. Java Recursion
    7,216
  11. Java Scope
    7,132
  12. Java Methods
    7,117
  13. Java While Loop/Do While Loop/For Loop/For-Each Loop/Break/Continue
    7,937
  14. Java Switch Statements
    7,436
  15. Java Short Hand If...Else (Ternary Operator)
    7,610
  16. Java If ... Else
    7,431
  17. Java Math
    7,462
  18. Java Variables
    7,502
  19. Java Comments
    8,082
  20. The Print() Method
    7,182
  21. Java Syntax
    7,483
  22. Java Getting Started
    7,434
  23. What is Java?
    7,121
  24. Challenge: One Code Problem Per Day
    1,165
  1. How do I replace content that based on the HTML UI Template
    7,183
  2. Dataset of California Foodbanks
    7,197
  3. Java Abstract Classes and Methods
    7,784
  4. Java Arrays
    8,812
Recently updated
  1. Michael Jackson's Billie Jean
    251
  2. Meet A2O Lite: Korea's Newest K-Pop Cuties with Addictively Catchy Melodies
    36
  3. Why You Can't Stop Watching Jack Bryan's Beatbox Gaming Shorts
    140
  4. Song So-hee: The Soulful Voice Touching Hearts Through Korean Music
    145
  5. Watch This Dazzling Dancer’s Mind-Blowing Moves
    181
  6. Bootstrap vs. Tailwind CSS: Origins, Features, Pros & Cons, and How to Choose the Right Framework
    222
  7. The Complete Guide to Golang: History, Features, Real-World Uses, and Code Examples
    725
  8. Telemetry vs. Analytics: Understanding the Difference and Why It Matters
    345
  9. The Evolution and Production Reality of Agentic AI
    294
  10. How to Activate or Waive Your UIUC Student Health Insurance
    375
  11. Complete Guide to Building a Machine Learning Model
    410
  12. My life cuts at Las Vegas during Thanksgiving day holiday
    7,503
  13. The Cybercab Transformation: From Autonomous Taxi to Mobile Base Station
    433
  14. Harness vs. OpenClaw: Two Very Different "Agents"
    1,099
  15. Clean Python Environments: The Power of venv vs. Docker
    932
  16. What is Docker? Why is Docker also useful in a development environment?
    689
  17. UIUC 2026-2027 Academic Calendar
    1,742
  18. How to Build Llama 3 AI Apps with Python: Setup & User Prompts
    894
  19. Open-Source LLMs: The AI Revolution
    847
  20. Resume 2.0: Leveling Up for My First Software Gig
    2,474
  21. Not everyone will understand what this man just did
    2,061
  22. UIUC Dorm Guide: Find Your Perfect Fit !!
    1,681
  23. Unpacking IU's Shopper
    854
  24. Jackie Chan's Police Story: The Action Masterpiece
    730
  25. The IVE Story: Identity, 'I AM' Charts, and Influence
    1,038
  26. Tech Visionaries who graduated at UIUC - You are the Next Turn
    1,259
  27. Open Databases for Sex Crime Occurrences in the U.S.
    793
  28. Automatically copy text to the clipboard when dragging the mouse in the Cursor
    2,881
  29. My First Day at University of Illinois-Urvana Champaign
    1,267
  30. Sand, Sea, and a Splash of Fun at Newport Beach: A Family Adventure
    8,239
  31. Sun, Rocks, and Adventure: A Day at Joshua Tree National Park
    8,333
  32. Sipping the Stars: My Starbucks Adventure
    9,810
  33. Exciting explore at Sequoia National Park
    7,754
  34. My Life Shot at Death Valley
    1,827
  35. Ip Man fights with Muay Thai Master
    1,013
  36. Mad Clown - Don't Die
    1,114
  37. How to get Student Enrollment and Degree Verification at UIUC
    5,174
  38. LAX Thanksgiving Rush: A Joyful Reunion
    977
  39. ZO ZAZZ(조째즈) - Don`t you know (모르시나요) (PROD.ROCOBERRY)
    1,212
  40. FISHINGIRLS Unleashes Energetic EP 'Funiverse' Featuring Signature Track 'Fishing King'
    1,054
  41. 10CM - To Reach You (너에게 닿기를)
    1,226
  42. Feeling weak? Transform yourself at the UIUC ARC!
    1,635
  43. BOYNEXTDOOR - If I Say I Love You
    1,251
  44. The Future of Software Engineer - AI Engineering
    982
  45. G Dragon x Taeyang (Eyes Nose Lips, Power, Home Sweet Home, GOOD BOY) - LE GALA PIÈCES JAUNES 2025
    987
  46. Lie - Legend song by BIGBANG
    7,891
  47. Why ROLLBACK is useful when you work with Google Gemini CLI?
    926
  48. Reimbursement after Vaccination at McKinley Health Center
    1,089
  49. Gemini CLI makes a Magic! Time to speed up your app development with Google Gemini CLI!
    1,026
  50. Common Questions from UIUC school life in terms of CS Program
    1,201