Skip to content

Abobakr/Advanced-Java-Lab

Repository files navigation

Advanced Java Labs 2026 (Java 26 & PostgreSQL)

Welcome to the Advanced Java course workspace. This repository contains three independent modern laboratory experiments consolidated into a single, clean Maven multi-module architecture running on cutting-edge Java 26.

📂 Repository Structure

  • lab01-modern-gui/: Desktop applications leveraging modern JavaFX (Declarative UI & Lambdas).
  • lab02-database-orm/: Database persistence using PostgreSQL paired with Jakarta JPA / Hibernate 7.x.
  • lab03-networking-threads/: High-concurrency network servers utilizing Java 26 Virtual Threads (Project Loom).

🛠️ Prerequisites & Setup

Ensure your local machine satisfies these requirements before launching the projects:

  1. Java Development Kit (JDK): Install JDK 26 or later.
  2. IDE: VS Code with the Extension Pack for Java installed.
  3. Database: A local instance of PostgreSQL running with a database named university.

🚀 How to Open and Run the Labs

Step 1: Open the Project Workspace

  1. Launch VS Code.
  2. Click File > Open Folder... and select the root java-advanced-labs directory.
  3. Wait for the Java extension to finish indexing the Maven projects.

Step 2: Set Up the Database Envelop (Lab 2 Prerequisites)

Before running the database application, your PostgreSQL server needs an empty target database. Open your database console or terminal and execute:

CREATE DATABASE university;

Step 3: Running a Specific Lab inside PowerShell

🔹 Lab 1: Modern GUI (JavaFX)

  1. Navigate to lab01-modern-gui/src/main/java/com/edu/gui/ModernApp.java.
  2. Click the Run button directly above the main method in VS Code.

🔹 Lab 2: Database & ORM (PostgreSQL)

  1. Ensure your PostgreSQL server is active.
  2. Update the credentials (user and password) inside DatabaseApp.java to match your local setup.
  3. Run the following command from the root directory inside your PowerShell window:
    mvn exec:java -pl lab02-database-orm '-Dexec.mainClass=com.edu.db.DatabaseApp'

🔹 Lab 3: Modern Networking (Virtual Threads)

  1. Open a PowerShell window at the root directory and start the server:
    mvn exec:java -pl lab03-networking-threads '-Dexec.mainClass=com.edu.network.ModernServer'
  2. Open a second separate PowerShell window and run the client to test concurrent connectivity:
    mvn exec:java -pl lab03-networking-threads '-Dexec.mainClass=com.edu.network.ModernClient'
  3. Type text into the client console to see the lightweight virtual thread instantly process and echo back your request. Type quit to disconnect safely.

⚙️ Building the Whole Workspace

To clean and compile all modules simultaneously from the command line, run this Maven command at the root directory:

mvn clean compile

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages