Single logo
  • Courses
  • Blog
  • About
Join on SkoolJoin on Skool

In this topic

Java
  • Install Java 25 (JDK) and IntelliJ IDEA, Then Run Your First Program
  • Use Claude Agent, Copilot or Junie Inside IntelliJ IDEA
  • Java Hello World with Maven: What the JDK Does and What Maven Adds
  • Java Variables, Keywords and Naming Rules
  • Maven in IntelliJ: pom.xml, Dependencies and the Build Lifecycle
  • Java Primitive Types and Memory: What int x = 5 Really Does
  • Java Strings and Text Blocks: Quotes, Concatenation and parseInt
  • Java Operators: Arithmetic, a++ vs ++a, Precedence, && || and the Ternary
  • Java Type Casting: Widening, Narrowing and Converting Text to Numbers
  • Java Practice Lab: A Cafe Bill with Variables, Operators and Casting
  • Java if, else and switch: Braces, Else-If Ladders and the Modern Switch
  • Java Loops: for, while, do-while and for-each
  • Java break, continue and Nested Loops
  • What's New in Java 21 to 25: Compact Source Files and Sequenced Collections
  • Java Arrays: Indexes, Default Values, Loops and 2D Grids
  • Java Methods and Overloading: Parameters, return and Pass-by-Value
  • Java Scope, Code Blocks and the Call Stack
  • Read User Input in Java with Scanner (and the Leftover Enter Trap)
  • Java Practice Lab: A Gym Weekly Tracker with Loops, Arrays and Methods
  • Debugging Java in IntelliJ: Stack Traces, Breakpoints and a Better AI Prompt
  • Java var: Let Java Infer the Type
  • Push and Pull in IntelliJ: Two Developers, One GitHub Repository, a Rejected Push and a Conflict
  • Java Classes and Objects: One Blueprint, Many Cars
  • Java Constructors and the this Keyword
  • Java Instance Methods, Getters, Setters and toString
  • Java static: Fields, Methods and Blocks Shared by the Whole Class
  • Java Packages and Imports: Every Class Has an Address
  • Java Access Modifiers and Encapsulation: Private Data, Public Methods
  • Java final and Immutable Objects: Assign Once, Share Safely
  • Java Strings as Objects: The String Pool, == vs equals, StringBuilder and printf
  • Java Practice Lab: A Library Book Catalogue with final Fields and StringBuilder
  • Java Inheritance: extends, super and the Order Objects Are Built
  • Java Method Overriding, @Override and the Object Class
  • Java Polymorphism: Upcasting, Dynamic Dispatch and Downcasting
  • Java Composition: Has-A vs Is-A
  • Java Abstract Classes: A Parent That Leaves One Blank
  • Java Interfaces: Contracts and Multiple Inheritance
  • Java Nested, Inner and Anonymous Classes
  • Java Enums with Fields, Methods and switch
  • Java Practice Lab: Payment Processing with an Interface, an Abstract Class and an Enum
  • Java Records: A Whole Data Class in One Line
  • Java Sealed Classes and Interfaces
  • Java Pattern Matching with instanceof and switch
  • Java Record Patterns: Unpacking a Record
  • Java equals and hashCode: Why a HashSet Needs Both
  • From Arrays to Collections: The Java Collections Framework Map
  • Java Wrapper Classes and Autoboxing
  • Java ArrayList: The Stretchy Array
  • Java LinkedList vs ArrayList: Nodes or an Array
  • Java Sets: HashSet, LinkedHashSet and TreeSet
  • Java Sorting with Comparable and Comparator
  • Java Maps: HashMap, LinkedHashMap and TreeMap
  • Java Stacks, Queues and Deques: ArrayDeque and PriorityQueue
  • Choosing a Java Collection: Immutable and Sequenced Collections
  • Java Exception Handling: try, catch and finally
  • Java throw, throws, Checked vs Unchecked and Custom Exceptions
  • Java try-with-resources and Clean Error Handling
  • Java Generics: Type-Safe Containers
  • Java Generic Methods, Bounded Types and Wildcards
  • Java Lambdas and Functional Interfaces
  • Java Built-in Functional Interfaces: Predicate, Function, Consumer, Supplier
  • Java Optional: Saying Maybe Without null
  • Java Streams I: filter, map and reduce
  • Java Streams II: Collectors, groupingBy and flatMap
  • Why Concurrency: Processes, Threads and the Main Thread in Java
  • Creating Threads in Java: Thread, Runnable and Lambdas
  • Java Thread Lifecycle: sleep, join and interrupt
  • Java Race Conditions and synchronized
  • Java volatile and Atomic Variables
  • Java ExecutorService and Thread Pools
  • Java Callable, Future and CompletableFuture
  • Java Locks, Deadlock and tryLock
  • Java Concurrent Collections and Virtual Threads
  • Why Slow Work Belongs off the Request Thread: 202 Accepted and a Job Id in Spring Boot
  • Virtual Threads in Spring Boot: One Property, and the Connection Pool Trap
  • @Async, Named TaskExecutors and Structured Concurrency in Spring Boot
  • Java Files and Directories with NIO.2: Path and Files
  • Reading and Writing Text Files in Java
  • Java Structured Data: Reading and Writing JSON and CSV
  1. Blog
  2. /
  3. Java
  4. /
  5. Basics

Use Claude Agent, Copilot or Junie Inside IntelliJ IDEA

Open IntelliJ's AI Chat, pick Claude Agent (the agent behind Claude Code) or Copilot and a model, ask in plain words for Main.java to print the date and time, review the change, and run it.

Chaand Sheikh

·27 November 2026·Updated 28 November 2026Basics

What you will learn

  • Open the AI Chat panel in IntelliJ IDEA and sign in once
  • Pick an agent (Claude Agent, Copilot, Junie) and a model
  • Explain what a coding agent does between your prompt and the file change
  • Review an agent's edit, keep or roll it back, then run the code

Before you start

  • JDK 25 and IntelliJ IDEA installed

IntelliJ IDEA has an AI Chat panel where several coding agents live side by side: Claude Agent (the agent behind Claude Code), GitHub Copilot, Codex, Junie by JetBrains and more. You open the panel, pick an agent and a model, ask for a change in plain words, and the agent edits the real files in your project.

This walk-through uses one small prompt on a sample project. The same panel handles much bigger jobs later, when you build a full web application.

Step 1: a small Java project

The AI features come from plugins. On the IntelliJ welcome screen, open Plugins: the AI Assistant plugin gives you the AI Chat, and the GitHub Copilot plugin is there too. If you can't find the AI Chat later, come back here, search for AI Assistant, install it and restart the IDE.

Then click New Project:

  • Keep Java selected on the left and give it a name. The lecture uses aicode.
  • Build system: IntelliJ, the simplest one. Maven comes later.
  • JDK: your JDK 25.
  • Keep Add sample code ticked, so you get a Main.java to work with.

Click Create and the project opens. The sample Main.java prints a welcome line, then a loop prints i from 1 to 5.

Step 2: open the AI Chat and pick an agent

Look at the right edge of the window and click the AI Chat icon. The panel says "Pair your IDE intelligence with AI" and lists the agents:

  • Claude Agent: Anthropic's coding agent, the same one behind Claude Code, running inside IntelliJ.
  • GitHub Copilot: asks you to sign in with your GitHub account.
  • Codex and Junie, the agent made by the JetBrains team. "More agents" lists many others.

You can also plug in a third-party provider with your own key, or a model running on your own machine, such as LM Studio.

Step 3: sign in once

Click the AI Assistant icon in the top bar. The first time, IntelliJ asks you to log in with your JetBrains account. The free quota is limited; a paid subscription gives you more. If you already have your own key (from Anthropic, for example), open Providers and API keys and add it there.

When that's done, the chat shows Claude Agent with "configured authentication: JetBrains". It's ready.

Step 4: choose the agent and the model

Under the prompt box there's a drop-down with the agent list: Claude Agent, Codex, Cursor, Gemini CLI, GitHub Copilot and Junie. You can switch any time. Junie is different in one way: you don't pick its model, it chooses one per task.

With Claude Agent you also pick the model: Opus, Sonnet or Haiku. For a small task, Sonnet is plenty. Version numbers change over time, so yours may look different. Below that is reasoning, how much the model thinks before it answers. Leave it on default.

What an agent does with your prompt

Before you send anything, it helps to know what happens in between.

You write a prompt. The agent plans the steps and uses the chosen model for thinking. It reads and edits Main.java in the real project. The change comes back to you to review, keep or roll back, and run. You write a prompt Agent plans the steps model: Sonnet Real project reads, edits Main.java Review keep, roll back you stay in charge: review, then run
The agent does the typing on real files. You review the change before you run it.

You write the prompt. The agent (Claude Agent, Copilot or Junie) plans the steps, using the model you picked for the thinking. Then it works on your real project: it reads Main.java and edits it. Those are real files and real changes. Finally the result comes back to you to review, keep or roll back, and run.

Step 5: prompt the agent

The prompt in the lecture is one plain sentence:

update my main.java and display date and time

That's enough. (It was dictated with a speech-to-text tool; typing works the same.) The bottom of the panel shows the agent and model, Claude Agent and Sonnet, and the permission mode.

The lecture's machine runs in bypass permissions, so the agent edits without asking. While you're learning, keep the default mode, where the agent asks before it changes a file. Then you see every change before it happens.

Click Send. The agent starts thinking and reads the project first.

Step 6: review the change

The chat shows what the agent did: it read Main.java, then edited it, "+10 lines". Below that it explains the change: it added a date-and-time line after the welcome message, formatted as year, month, day, then hours, minutes and seconds. It also says it hasn't run the code. Running it is your job.

In the editor, the new lines use a LocalDateTime for the current moment, a DateTimeFormatter for the format, and a print line that uses both. The existing code stayed as it was.

At the bottom you get Done and Rollback. Rollback puts the file back the way it was. This change looks right, so keep it.

Step 7: run it

Click the green arrow next to void main and choose Run 'Main.main()', or press Shift+F10. The Run window prints the welcome line, then the current date and time of the run, and the loop still prints i from 1 to 5. The agent changed exactly what was asked and left the rest alone.

Common mistakes

  • No AI Chat icon. The AI Assistant plugin isn't installed. Install it from Plugins and restart.
  • Learning in bypass mode. You miss every change. Keep the default "ask before editing" mode until you're comfortable reading diffs.
  • Trusting without running. The agent itself said it hadn't run the code. Always run it and check the output.
  • Reaching for the biggest model. A one-file change doesn't need Opus. Sonnet handles it.

Recap

StepWhereWhat to remember
PluginsWelcome screenAI Assistant gives you the AI Chat
Sign inAI Assistant icon, top barJetBrains account, or your own API key
Agent and modelDrop-down under the promptClaude Agent + Sonnet for small tasks; Junie picks its own model
PromptPrompt boxPlain words, default permission mode
ReviewChat + editorDone or Rollback
RunGreen arrow or Shift+F10Check the output yourself

Try it yourself: on the same sample project, ask the agent to print the loop numbers in reverse, review the diff, and roll it back if it touched anything you didn't ask for. For a wider look at the agents themselves, see Coding Agents Compared.

Keep going in Java · 2 of 79

Previous
Install Java 25 (JDK) and IntelliJ IDEA, Then Run Your First Program
Next post
Java Hello World with Maven: What the JDK Does and What Maven Adds
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

FULL STACK JAVA : JAVA + JSP + SPRING BOOT AI + REACT + VIBE

Java 25, JSP, Hibernate, Spring Boot 4, REST APIs, React and Spring AI.View on Udemy ↗: FULL STACK JAVA : JAVA + JSP + SPRING BOOT AI + REACT + VIBE (paid course, opens in a new tab)

Related posts

Install Java 25 (JDK) and IntelliJ IDEA, Then Run Your First Program

Install JDK 25 (Microsoft Build of OpenJDK) with JAVA_HOME, install IntelliJ IDEA, then point a run configuration at the JDK and the main class and run Hello World.

Java Hello World with Maven: What the JDK Does and What Maven Adds

javac compiles HelloWorld.java into bytecode and java runs it on the JVM. Maven adds one pom.xml, the same folders in every project and one build command. Then a real Maven Hello World in IntelliJ.

Java Variables, Keywords and Naming Rules

A variable is a labelled jar that holds one value at a time. Four small programs show declaring, reassigning, the names Java accepts, the keywords it reserves, and why daysUntilLaunch beats d.

Maven in IntelliJ: pom.xml, Dependencies and the Build Lifecycle

Open a plain project and a Maven project in IntelliJ, read an invoice app's pom.xml, follow jackson-databind from Maven Central into ~/.m2, and see why each lifecycle phase runs the ones before it.

On this page

  • Step 1: a small Java project
  • Step 2: open the AI Chat and pick an agent
  • Step 3: sign in once
  • Step 4: choose the agent and the model
  • What an agent does with your prompt
  • Step 5: prompt the agent
  • Step 6: review the change
  • Step 7: run it
  • Common mistakes
  • Recap
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

FULL STACK JAVA : JAVA + JSP + SPRING BOOT AI + REACT + VIBE

Java 25, JSP, Hibernate, Spring Boot 4, REST APIs, React and Spring AI.View on Udemy ↗: FULL STACK JAVA : JAVA + JSP + SPRING BOOT AI + REACT + VIBE (paid course, opens in a new tab)

Single logo

Empowering Education, One Course at a Time

About
About usContact us
Legal
Terms of UsePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.