← Back to Home

Module 1: Command-line and IDE Basics

Module Overview

In this module, you'll learn how to navigate a command-line shell, iterate through an edit-build-test cycle locally from the command-line, and develop code using an Integrated Development Environment (IDE).

Learning Objectives

Content

Command Line and IDE Basics

Command Line Essentials

The command line is a text-based interface to interact with your computer. Different operating systems offer different terminal options:

  • MacOS: Terminal (Bash, Zsh)
  • Windows: Command Prompt, Git Bash, PowerShell

Basic Navigation Commands

  • pwd - Shows current working directory (Print Working Directory)
  • ls - Lists current contents of working directory
    • dir on Windows Command Prompt
    • ls -a displays all contents including hidden files
  • cd - Change directory
    • cd .. moves one directory up
    • cd ~ moves directly to home directory
  • clear - Clear the screen
    • cls on Windows
    • Command-K shortcut on MacOS

Working with Directories and Files

  • mkdir - Create a directory
  • touch - Creates a file
    • echo > filename for Windows Command Prompt
  • vim - Opens a file with vim (will create if the file does not exist)
  • rm - Remove a file
    • del on Windows Command Prompt
    • rm -r for directories and everything inside

Example Command Sequence

Here's an example of creating a simple Java project from the command line:

mkdir MyJavaProject
cd MyJavaProject
mkdir src
touch src/HelloWorld.java
# Now edit HelloWorld.java with an editor or IDE

IntelliJ Tips

IntelliJ IDEA Basics

IntelliJ IDEA is a powerful IDE (Integrated Development Environment) that provides tools to help you write, test, and debug your Java code efficiently.

Key Features

  • Project Structure: Organizes your code in a hierarchical structure
  • Code Completion: Suggests code as you type
  • Refactoring Tools: Helps restructure existing code safely
  • Debugging: Set breakpoints, inspect variables, and step through code
  • Version Control Integration: Work with Git directly from the IDE

Useful Keyboard Shortcuts

  • Ctrl+Space or Cmd+Space: Code completion
  • Alt+Enter or Option+Enter: Show intention actions/quick fixes
  • Shift+F10 or Ctrl+R: Run current configuration
  • Ctrl+/ or Cmd+/: Comment/uncomment current line
  • Ctrl+D or Cmd+D: Duplicate current line

Edit-Build-Test Cycle

A typical workflow in IntelliJ involves:

  1. Edit: Write or modify your code
  2. Build: Compile your code (often automatic in IntelliJ)
  3. Test: Run your application or unit tests to verify functionality
  4. Debug: If issues arise, use the debugger to identify and fix problems

Guided Project

Gradle Test Project

This guided project will walk you through:

  • Setting up a Java project using Gradle as a build tool
  • Running and interpreting tests from the command line and IDE
  • Understanding the project structure in a real-world development scenario
  • Using basic Git commands to manage your code changes

By following along, you'll gain practical experience with the complete edit-build-test cycle that professional developers use daily.

GitHub Repository

Additional Resources