Skip to content

Sajee119/User-Profile-Management

Repository files navigation

How to Run the User & Profile Management System

Method 1: Using Command Line/Terminal

Step-by-Step Instructions:

1. Save the Files

Create a new folder/directory on your computer and save all three Java files:

C:\UserManagement\  (Windows)
or
/Users/YourName/UserManagement/  (Mac/Linux)

Save these files:

  • User.java
  • UserService.java
  • UserManagementSystem.java

2. Open Terminal/Command Prompt

Windows:

  • Press Win + R, type cmd, press Enter
  • Navigate to your folder:
cd C:\UserManagement

Mac/Linux:

  • Open Terminal
  • Navigate to your folder:
cd /Users/YourName/UserManagement

3. Compile the Java Files

Compile all Java files together:

javac User.java UserService.java UserManagementSystem.java

If successful: No messages will appear (silent success)

If you get "javac not recognized":

4. Run the Program

java UserManagementSystem

5. Expected Output

=====================================
   USER & PROFILE MANAGEMENT SYSTEM   
=====================================

=====================================
   Status: Not Logged In
=====================================
1. Register New User
2. Login
3. Update My Profile
4. Search User Profile
5. View All Users
6. Logout
7. Exit
=====================================
Enter your choice:

Method 2: Using an IDE (Easier for Beginners)

Using IntelliJ IDEA:

  1. Open IntelliJ IDEA
  2. Create a new Java project
  3. Create a new package (e.g., com.usermanagement)
  4. Create three Java classes with the exact names:
    • User.java
    • UserService.java
    • UserManagementSystem.java
  5. Copy the code into each file
  6. Right-click on UserManagementSystem.java
  7. Select Run 'UserManagementSystem.main()'

Using Eclipse:

  1. Open Eclipse
  2. Create a new Java Project (File → New → Java Project)
  3. Create a new class for each file (Right-click src → New → Class)
  4. Paste the code into each class
  5. Run UserManagementSystem.java (Right-click → Run As → Java Application)

Using VS Code:

  1. Install Java Extension Pack
  2. Create a new folder and open it in VS Code
  3. Create three .java files
  4. Click the "Run" button above the main method
  5. Or use terminal: javac *.java then java UserManagementSystem

Sample Program Execution:

Register a User:

Enter your choice: 1

=== USER REGISTRATION ===
Enter Name (min 2 characters): John Doe
Enter Email (valid format): john@example.com
Enter Password (min 6 chars): password123
Enter Role (Admin/User/Guest): User
✓ User registered successfully!

Login:

Enter your choice: 2

=== USER LOGIN ===
Enter Email: john@example.com
Enter Password: password123
✓ Login successful! Welcome John Doe

Update Profile:

Enter your choice: 3

=== UPDATE PROFILE ===
Current Information:
┌─────────────────────────┐
│ Name     : John Doe
│ Email    : john@example.com
│ Role     : User
└─────────────────────────┘

What would you like to update?
1. Name
2. Password
3. Both
Enter choice (1-3): 1
Enter new Name (min 2 chars): John Smith
✓ Profile updated successfully!

Troubleshooting Common Errors:

Error 1: javac is not recognized

Solution: Install Java JDK

  • Download JDK from Oracle website
  • Add Java to system PATH

Error 2: class UserManagementSystem not found

Solution: Make sure you're in the correct directory

# Check if files exist
dir  (Windows)
ls   (Mac/Linux)

Error 3: cannot find symbol

Solution: Compile all files together

javac *.java

Error 4: users.txt (Access denied)

Solution: Run terminal as Administrator (Windows) or use sudo (Mac/Linux)

sudo java UserManagementSystem  (Mac/Linux)

Quick Test Commands:

After running the program, test these scenarios:

  1. Register → Choice 1 → Enter valid data
  2. Login → Choice 2 → Use registered credentials
  3. View All Users → Choice 5 → See all registered users
  4. Update Profile → Choice 3 → Change name or password
  5. Search User → Choice 4 → Search by email
  6. Logout → Choice 6 → Log out current user
  7. Exit → Choice 7 → Close program

File Location:

The users.txt file will be created automatically in the same directory as your Java files. You can open it with any text editor to see the stored data:

John Doe|john@example.com|password123|User
Jane Smith|jane@example.com|mypass456|Admin

Need Help?

If you encounter any issues, check:

  • Java version: java -version
  • Compiler version: javac -version
  • Current directory: pwd (Mac/Linux) or cd (Windows)
  • File permissions: Make sure you can write to the directory

The program is ready to run! Let me know if you face any specific errors.

About

A Java-based User & Profile Management System built using Object-Oriented Programming principles. This project demonstrates user handling with features like profile management, file-based data storage, and modular architecture. It includes separate classes for user modeling, business logic, and a menu-driven console application

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages