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

JK JK 2038 
Created at  
7,248 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,179
  2. Java Tutorials associated with AP Computer Science A
    7,753
  3. Difference between Java and Javascript
    7,724
  4. Machine Learning Types and Programming Languages
    7,322
  5. Java Inner Classes
    7,143
  6. Java Polymorphism
    7,123
  7. Java Inheritance (Subclass and Superclass)
    7,238
  8. Java Packages
    7,241
  9. Java Classes and Objects
    7,184
  10. Java Recursion
    7,249
  11. Java Scope
    7,184
  12. Java Methods
    7,156
  13. Java While Loop/Do While Loop/For Loop/For-Each Loop/Break/Continue
    8,021
  14. Java Switch Statements
    7,495
  15. Java Short Hand If...Else (Ternary Operator)
    7,666
  16. Java If ... Else
    7,495
  17. Java Math
    7,518
  18. Java Variables
    7,562
  19. Java Comments
    8,187
  20. The Print() Method
    7,218
  21. Java Syntax
    7,541
  22. Java Getting Started
    7,489
  23. What is Java?
    7,149
  24. Challenge: One Code Problem Per Day
    1,248
  1. How do I replace content that based on the HTML UI Template
    7,214
  2. Dataset of California Foodbanks
    7,231
  3. Java Abstract Classes and Methods
    7,860
  4. Java Arrays
    8,963
Recently updated
  1. Comprehensive Guide to Recent Critical PHP Vulnerabilities
    616
  2. How to Check Your UIUC Graduation Progress Using DARS Audit
    545
  3. Michael Jackson's Billie Jean
    352
  4. Meet A2O Lite: Korea's Newest K-Pop Cuties with Addictively Catchy Melodies
    264
  5. Why You Can't Stop Watching Jack Bryan's Beatbox Gaming Shorts
    267
  6. Song So-hee: The Soulful Voice Touching Hearts Through Korean Music
    304
  7. Watch This Dazzling Dancer’s Mind-Blowing Moves
    317
  8. Bootstrap vs. Tailwind CSS: Origins, Features, Pros & Cons, and How to Choose the Right Framework
    347
  9. The Complete Guide to Golang: History, Features, Real-World Uses, and Code Examples
    1,064
  10. Telemetry vs. Analytics: Understanding the Difference and Why It Matters
    498
  11. The Evolution and Production Reality of Agentic AI
    388
  12. How to Activate or Waive Your UIUC Student Health Insurance
    486
  13. Complete Guide to Building a Machine Learning Model
    508
  14. My life cuts at Las Vegas during Thanksgiving day holiday
    7,577
  15. The Cybercab Transformation: From Autonomous Taxi to Mobile Base Station
    530
  16. Harness vs. OpenClaw: Two Very Different "Agents"
    1,287
  17. Clean Python Environments: The Power of venv vs. Docker
    1,058
  18. What is Docker? Why is Docker also useful in a development environment?
    777
  19. UIUC 2026-2027 Academic Calendar
    1,910
  20. How to Build Llama 3 AI Apps with Python: Setup & User Prompts
    1,027
  21. Open-Source LLMs: The AI Revolution
    945
  22. Resume 2.0: Leveling Up for My First Software Gig
    2,800
  23. Not everyone will understand what this man just did
    2,309
  24. UIUC Dorm Guide: Find Your Perfect Fit !!
    1,800
  25. Unpacking IU's Shopper
    947
  26. Jackie Chan's Police Story: The Action Masterpiece
    824
  27. The IVE Story: Identity, 'I AM' Charts, and Influence
    1,147
  28. Tech Visionaries who graduated at UIUC - You are the Next Turn
    1,352
  29. Open Databases for Sex Crime Occurrences in the U.S.
    918
  30. Automatically copy text to the clipboard when dragging the mouse in the Cursor
    3,204
  31. My First Day at University of Illinois-Urvana Champaign
    1,348
  32. Sand, Sea, and a Splash of Fun at Newport Beach: A Family Adventure
    8,362
  33. Sun, Rocks, and Adventure: A Day at Joshua Tree National Park
    8,441
  34. Sipping the Stars: My Starbucks Adventure
    10,020
  35. Exciting explore at Sequoia National Park
    7,837
  36. My Life Shot at Death Valley
    1,981
  37. Ip Man fights with Muay Thai Master
    1,102
  38. Mad Clown - Don't Die
    1,219
  39. How to get Student Enrollment and Degree Verification at UIUC
    5,593
  40. LAX Thanksgiving Rush: A Joyful Reunion
    1,060
  41. ZO ZAZZ(조째즈) - Don`t you know (모르시나요) (PROD.ROCOBERRY)
    1,315
  42. FISHINGIRLS Unleashes Energetic EP 'Funiverse' Featuring Signature Track 'Fishing King'
    1,125
  43. 10CM - To Reach You (너에게 닿기를)
    1,309
  44. Feeling weak? Transform yourself at the UIUC ARC!
    1,717
  45. BOYNEXTDOOR - If I Say I Love You
    1,341
  46. The Future of Software Engineer - AI Engineering
    1,068
  47. G Dragon x Taeyang (Eyes Nose Lips, Power, Home Sweet Home, GOOD BOY) - LE GALA PIÈCES JAUNES 2025
    1,070
  48. Lie - Legend song by BIGBANG
    7,968
  49. Why ROLLBACK is useful when you work with Google Gemini CLI?
    1,045
  50. Reimbursement after Vaccination at McKinley Health Center
    1,171