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

JK 2010 
Created at  
7,152 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,103
  2. Java Tutorials associated with AP Computer Science A
    7,565
  3. Difference between Java and Javascript
    7,578
  4. Machine Learning Types and Programming Languages
    7,217
  5. Java Inner Classes
    7,030
  6. Java Polymorphism
    7,038
  7. Java Inheritance (Subclass and Superclass)
    7,168
  8. Java Packages
    7,160
  9. Java Classes and Objects
    7,063
  10. Java Recursion
    7,182
  11. Java Scope
    7,076
  12. Java Methods
    7,064
  13. Java While Loop/Do While Loop/For Loop/For-Each Loop/Break/Continue
    7,817
  14. Java Switch Statements
    7,380
  15. Java Short Hand If...Else (Ternary Operator)
    7,549
  16. Java If ... Else
    7,372
  17. Java Math
    7,414
  18. Java Variables
    7,435
  19. Java Comments
    7,969
  20. The Print() Method
    7,137
  21. Java Syntax
    7,417
  22. Java Getting Started
    7,385
  23. What is Java?
    7,076
  24. Challenge: One Code Problem Per Day
    1,054
  1. Java Servlet Example
    7,103
  2. How do I replace content that based on the HTML UI Template
    7,140
  3. Dataset of California Foodbanks
    7,155
  4. Java Tutorials associated with AP Computer Science A
    7,565
  5. Java Inner Classes
    7,030
  6. Java Polymorphism
    7,038
  7. Java Inheritance (Subclass and Superclass)
    7,168
  8. Java Packages
    7,160
  9. Java Abstract Classes and Methods
    7,690
  10. Java Classes and Objects
    7,063
  11. Java Recursion
    7,182
  12. Java Scope
    7,076
  13. Java Methods
    7,064
  14. Java Arrays
    8,634
  15. Java While Loop/Do While Loop/For Loop/For-Each Loop/Break/Continue
    7,817
  16. Java Switch Statements
    7,380
  17. Java Short Hand If...Else (Ternary Operator)
    7,549
Recently updated
  1. Bootstrap vs. Tailwind CSS: Origins, Features, Pros & Cons, and How to Choose the Right Framework
    102
  2. The Complete Guide to Golang: History, Features, Real-World Uses, and Code Examples
    255
  3. Telemetry vs. Analytics: Understanding the Difference and Why It Matters
    187
  4. The Evolution and Production Reality of Agentic AI
    177
  5. How to Activate or Waive Your UIUC Student Health Insurance
    258
  6. Complete Guide to Building a Machine Learning Model
    298
  7. My life cuts at Las Vegas during Thanksgiving day holiday
    7,379
  8. The Cybercab Transformation: From Autonomous Taxi to Mobile Base Station
    322
  9. Harness vs. OpenClaw: Two Very Different "Agents"
    920
  10. Clean Python Environments: The Power of venv vs. Docker
    793
  11. What is Docker? Why is Docker also useful in a development environment?
    595
  12. UIUC 2026-2027 Academic Calendar
    1,529
  13. How to Build Llama 3 AI Apps with Python: Setup & User Prompts
    778
  14. Open-Source LLMs: The AI Revolution
    728
  15. Resume 2.0: Leveling Up for My First Software Gig
    2,124
  16. Not everyone will understand what this man just did
    1,757
  17. UIUC Dorm Guide: Find Your Perfect Fit !!
    1,558
  18. Unpacking IU's Shopper
    729
  19. Jackie Chan's Police Story: The Action Masterpiece
    620
  20. The IVE Story: Identity, 'I AM' Charts, and Influence
    923
  21. Tech Visionaries who graduated at UIUC - You are the Next Turn
    1,162
  22. Open Databases for Sex Crime Occurrences in the U.S.
    690
  23. Automatically copy text to the clipboard when dragging the mouse in the Cursor
    2,554
  24. My First Day at University of Illinois-Urvana Champaign
    1,162
  25. Sand, Sea, and a Splash of Fun at Newport Beach: A Family Adventure
    8,097
  26. Sun, Rocks, and Adventure: A Day at Joshua Tree National Park
    8,177
  27. Sipping the Stars: My Starbucks Adventure
    9,597
  28. Exciting explore at Sequoia National Park
    7,629
  29. My Life Shot at Death Valley
    1,650
  30. Ip Man fights with Muay Thai Master
    912
  31. Mad Clown - Don't Die
    987
  32. How to get Student Enrollment and Degree Verification at UIUC
    4,713
  33. LAX Thanksgiving Rush: A Joyful Reunion
    904
  34. ZO ZAZZ(조째즈) - Don`t you know (모르시나요) (PROD.ROCOBERRY)
    1,093
  35. FISHINGIRLS Unleashes Energetic EP 'Funiverse' Featuring Signature Track 'Fishing King'
    958
  36. 10CM - To Reach You (너에게 닿기를)
    1,136
  37. Feeling weak? Transform yourself at the UIUC ARC!
    1,555
  38. BOYNEXTDOOR - If I Say I Love You
    1,165
  39. The Future of Software Engineer - AI Engineering
    917
  40. G Dragon x Taeyang (Eyes Nose Lips, Power, Home Sweet Home, GOOD BOY) - LE GALA PIÈCES JAUNES 2025
    889
  41. Lie - Legend song by BIGBANG
    7,796
  42. Why ROLLBACK is useful when you work with Google Gemini CLI?
    814
  43. Reimbursement after Vaccination at McKinley Health Center
    990
  44. Gemini CLI makes a Magic! Time to speed up your app development with Google Gemini CLI!
    946
  45. Common Questions from UIUC school life in terms of CS Program
    1,087
  46. UIUC Immunization Compliance
    1,181
  47. LEE CHANHYUK's songs really resonate with my soul - Time Stop! Vivid LaLa Love, Eve, Endangered Love ...
    1,075
  48. LEE CHANHYUK - Endangered Love (멸종위기사랑)
    1,075
  49. Cupid (OT4/Twin Ver.) - LIVE IN STUDIO | FIFTY FIFTY (피프티피프티)
    851
  50. Common methods to improve coding skills
    971