Menu
Module 1 / 8 Beginner 15 min read

Getting Started

Install Claude Code, point it at a real Maven or Gradle project, and run your first useful session.

In this module

Install the CLI, authenticate, choose between terminal and IntelliJ, and complete a first task in an existing Java codebase.

Why a Java developer should care

You already have an IDE that autocompletes, refactors, and runs your tests. Claude Code is not a replacement for IntelliJ — it is a different kind of tool. IntelliJ knows the structure of your code. Claude Code reads your code the way a new teammate would: it opens files, runs your build, reads the failures, and changes things across the whole repository to reach a goal you describe in plain English.

For a Java developer that turns out to be unusually valuable, because so much of our work is mechanical but not automatable by a refactoring tool: writing the next twenty JUnit tests, threading a new constructor argument through a layered Spring service, migrating javax.* to jakarta.*, or figuring out why one Testcontainers integration test is flaky. This course teaches you to delegate that work well — and to recognise the work you should keep.

Before you start, you’ll want: an existing Maven or Gradle project to work in (real code beats a toy), a Claude subscription or an Anthropic API key (below), and — for the integration-test examples from later modules — Docker running locally for Testcontainers.

Install the CLI

Claude Code installs as a native binary. On macOS, Linux, or WSL:

curl -fsSL https://claude.ai/install.sh | bash

Prefer the npm package? It’s published too, and needs Node.js 18 or newer:

npm install -g @anthropic-ai/claude-code

Either way, verify the install and check the version:

claude --version

On the JVM toolchain: Claude Code is self-contained — the native install needs no Node at all, and even the npm route uses Node only to run the CLI itself. Neither touches your project’s runtime. Your Java 21, your Maven wrapper, and your Gradle daemon are untouched.

Authenticate

Run claude for the first time inside any directory and it will walk you through authentication:

cd ~/work/my-spring-service
claude

You can sign in two ways:

  • A Claude subscription (Pro or Max) — you log in through the browser, and usage counts against your plan. This is the simplest option for individual developers.
  • An Anthropic API key from the Console — usage is billed per token. This is common for teams that want centralized billing or to run Claude Code in CI.

Pick whichever matches how you’ll be billed. You can change it later with /login. Either way, usage isn’t free: a subscription meters sessions against your plan’s limits, and an API key bills per token — and as you’ll see, bigger context and more subagents mean more tokens. Module 8 returns to cost and limits as an adoption question; for now, just know the meter is running.

Terminal or IntelliJ?

Claude Code is, at its core, a terminal program. But most Java developers live in IntelliJ IDEA (or another JetBrains IDE), and there is a first-class plugin for exactly that.

  • Terminal — run claude in any shell. This is the canonical experience and the one this course assumes. Everything works here.
  • JetBrains plugin — install “Claude Code” from the IntelliJ plugin marketplace. You get the same agent in a tool window, with the bonus that Claude sees your current selection and open files, and diffs are shown inline in the editor you already trust.
  • VS Code extension — the equivalent for VS Code users.

A good habit: keep Claude Code in a terminal beside IntelliJ, or in the IDE tool window, and let IntelliJ do what it is best at — navigation, the debugger, and final human review of every diff.

Your first session

Start in an existing project. Don’t reach for a toy example; Claude Code is most convincing on real code. Open your service and ask it to orient itself:

> Give me a tour of this codebase. What kind of application is it,
  what build tool and major frameworks does it use, and where does
  a request enter the system?

Claude will read your pom.xml or build.gradle, scan the package layout, and summarise the architecture. Notice what it did: it ran read-only commands and opened files on its own. That is the agentic loop, and you’ll learn to steer it in Module 2.

Now give it something concrete and low-risk:

> The OrderService.cancel(...) method has no test. Write a focused
  JUnit 5 test for it using the same style as the existing tests in
  this module. Run it and make sure it passes.

Claude will find your existing test conventions, write a new test, run mvn test or ./gradlew test, read the result, and fix the test if it fails. When it wants to run a command or edit a file, it asks for permission the first time. Read each diff before you approve it — that habit is the whole game.

Tip: Type /help at any time to see available commands, and /clear to start a fresh conversation when you switch tasks. A focused context produces better results than one long session that drifts across five unrelated jobs.

What just happened

In one session you installed a tool, pointed it at production code, and had it write and verify a test without you opening a single file by hand. The two skills that make the difference from here on are how you describe the goal and how you keep Claude’s context clean and accurate — the subjects of the next two modules.

Key takeaways

  • Install with npm install -g @anthropic-ai/claude-code; it needs Node 18+ but never touches your JVM toolchain.
  • Authenticate with a Claude subscription (simplest) or an Anthropic API key (team/CI billing).
  • Use the terminal as the canonical experience; add the JetBrains or VS Code integration so diffs land in the editor you already trust.
  • Start on real code, begin with a tour, then delegate a small, verifiable task and read every diff.