DEV Community

Cover image for πŸš€ Day 16 of My Automation Journey – Installing Java, Eclipse & Setting Up Maven for Selenium
bala d kaveri
bala d kaveri

Posted on

πŸš€ Day 16 of My Automation Journey – Installing Java, Eclipse & Setting Up Maven for Selenium

Welcome back to Day 16 of My Automation Journey! β˜•πŸ’»

In the previous days, I focused on Java fundamentals like:

πŸ” Encapsulation
πŸ“¦ Packages
🧩 Access Modifiers
πŸ” Method Overriding

But before writing Selenium automation scripts, we need to prepare our development environment properly.

So today’s goal was simple but important:

βš™οΈ Install and configure the tools required for Selenium Automation

🧰 Tools Required for Selenium Automation

Before writing our first automation script, we need the following tools.

Tool             Purpose
β˜• Java (JDK)   Programming language used for Selenium
πŸ’» Eclipse IDE     Writing and managing automation code
πŸ“¦ Maven   Dependency management & project structure
πŸ€– Selenium    Automation library for browser testing
Enter fullscreen mode Exit fullscreen mode

Setting these up correctly helps avoid environment issues later.

β˜• Step 1 – Install Java (JDK)

Selenium with Java requires the Java Development Kit (JDK).

πŸ“₯ Download JDK

Download the latest LTS version such as:

JDK 17

JDK 21

After downloading, run the installer and complete the setup.

Typical installation path:

C:\Program Files\Java\jdk-17
Enter fullscreen mode Exit fullscreen mode

βš™οΈ Step 2 – Configure JAVA_HOME

To allow the system to access Java globally, we must configure environment variables.

Steps

1️⃣ Open System Properties
2️⃣ Click Environment Variables
3️⃣ Under System Variables, add:

JAVA_HOME = C:\Program Files\Java\jdk-17
Enter fullscreen mode Exit fullscreen mode

Now update the Path variable and add:

%JAVA_HOME%\bin
Enter fullscreen mode Exit fullscreen mode

βœ… Step 3 – Verify Java Installation

Open Command Prompt and run:

java -version
Enter fullscreen mode Exit fullscreen mode

Example output:

java version "17.0.x"
Enter fullscreen mode Exit fullscreen mode

Now verify the compiler:

javac -version
Enter fullscreen mode Exit fullscreen mode

If both commands work, Java is installed correctly. πŸŽ‰

πŸ’» Step 4 – Install Eclipse IDE

Next, we need an IDE to write and manage our automation code.

One of the most popular IDEs for Java automation is Eclipse.

πŸ“₯ Download Eclipse

Download:

πŸ‘‰ Eclipse IDE for Java Developers

Installation

1️⃣ Run the Eclipse Installer
2️⃣ Select Eclipse IDE for Java Developers
3️⃣ Choose installation location
4️⃣ Launch Eclipse

The first time Eclipse opens, it will ask for a Workspace location.

Example:

C:\Users\YourName\workspace
Enter fullscreen mode Exit fullscreen mode

πŸ“¦ Step 5 – Maven (No Separate Installation Needed!)

Here’s something interesting I learned today. πŸ‘€

πŸ‘‰ Eclipse already includes Maven support by default.

This is called the m2e (Maven Integration for Eclipse) plugin.

So for most Selenium automation setups:

βœ… You DO NOT need to install Maven separately.

Eclipse automatically handles:

  • Maven project creation
  • Dependency management
  • Build lifecycle

This makes setup much simpler for beginners. πŸš€

πŸ— Step 6 – Create a Maven Project in Eclipse

Now let’s create our automation project.

Inside Eclipse:

1️⃣ Click File β†’ New β†’ Maven Project
2️⃣ Select Create a simple project
3️⃣ Enter:

Group Id β†’ com.automation

Artifact Id β†’ selenium-project
Enter fullscreen mode Exit fullscreen mode

Click Finish.

Eclipse will automatically generate the Maven structure.

πŸ“‚ Maven Project Structure

After creation, your project will look like this:

src/main/java
src/test/java
pom.xml
Important File
Enter fullscreen mode Exit fullscreen mode

πŸ“„ pom.xml

This file manages all project dependencies like:

  • Selenium
  • TestNG
  • WebDriverManager
  • Logging libraries

Instead of manually downloading jars, Maven handles everything automatically.

πŸ’‘ My Key Learning Today

Today was all about building the right foundation for Selenium automation.

Things I learned today:

βœ” How Java powers Selenium automation
βœ” Why Eclipse is widely used for automation testing
βœ” Maven is already integrated in Eclipse
βœ” Dependencies can be managed easily using pom.xml

This setup will help me build clean and scalable automation frameworks.

πŸ€– A Small Note
I used ChatGPT to help structure and refine this blog while ensuring the concepts remain aligned with my trainer’s explanations.

Top comments (0)