How to Seamlessly Integrate DeepSeek AI into IntelliJ IDEA for Java Development
This guide walks Java developers through preparing the environment, installing the CodeGPT plugin, configuring DeepSeek API keys and models, and using the AI assistant for code generation, completion, explanation, and troubleshooting directly within IntelliJ IDEA, while also showing usage statistics.
Environment Preparation
IDE version
IntelliJ IDEA 2023.x or newer is required for the CodeGPT plugin, which proxies DeepSeek.
https://plugins.jetbrains.com/plugin/21056-codegpt
Python
DeepSeek requires Python 3.7+ on the system PATH. Verify the installation:
python --version
Python 3.12.8Install CodeGPT Plugin
From Marketplace
Windows/Linux: Settings → Plugins → Marketplace, search “CodeGPT”, Install.
macOS: Preferences → Plugins → Marketplace, search “CodeGPT”, Install.
Restart IDEA after installation.
Configure DeepSeek in CodeGPT
API key
Generate an API key on https://www.deepseek.com/ (API Open Platform) and copy it.
Custom OpenAI settings
API Key – paste the generated key.
Chat model – URL https://api.deepseek.com/chat/completions, model deepseek-chat.
Reasoning model – enable Enable code completions and Parse response as Chat Completions, select FIM template DeepSeek Coder, use the same endpoint URL, model deepseek-reasoner.
Using DeepSeek in IntelliJ IDEA
Generate code
Open the CodeGPT panel, select “Custom OpenAI”, and enter a prompt such as “Write a Java method that filters numbers and provide a test”. Example output:
public class TestNumberFilter {
public static String filterNumbers(String input) {
// Remove all non‑digit characters
return input.replaceAll("[^0-9]", "");
}
public static void main(String[] args) {
String testInput2 = "SSFSDFS结论萨芬122432的噶大都是4无人区是14认识832safsss";
String result = filterNumbers(testInput2);
System.out.println("Filtered numbers: " + result); // Output: 123456
}
}Code completion
While typing, press Ctrl+Space (or a custom shortcut). DeepSeek analyses the context and suggests the next lines.
Code explanation
Select a code block, right‑click and choose “CodeGPT”. DeepSeek returns a natural‑language description of the code.
Ask questions
Highlight code or describe an issue, then choose “CodeGPT: Ask Question”. The assistant provides targeted suggestions.
Reference documentation
https://api-docs.deepseek.com/zh-cn/
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Architect Essentials
Committed to sharing quality articles and tutorials to help Java programmers progress from junior to mid-level to senior architect. We curate high-quality learning resources, interview questions, videos, and projects from across the internet to help you systematically improve your Java architecture skills. Follow and reply '1024' to get Java programming resources. Learn together, grow together.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
