Integrating DeepSeek AI Assistant into IntelliJ IDEA for Java Development
This guide walks Java developers through preparing the environment, installing the CodeGPT plugin, configuring DeepSeek API keys, and using the DeepSeek AI assistant within IntelliJ IDEA to generate, complete, explain, and troubleshoot code, while also showing usage statistics.
Introduction
In early 2025, AI tools surged in China, and developers quickly adopted new capabilities. DeepSeek, a high‑performance AI model, can be integrated into IntelliJ IDEA to act as a smart coding assistant, boosting productivity for Java developers.
1. Environment Preparation
IDEA Version Compatibility
Use a recent IDEA version (2023.x or later) and install the CodeGPT plugin, an AI‑driven code assistant that rivals GitHub Copilot and other JetBrains plugins.
https://plugins.jetbrains.com/plugin/21056-codegpt
Python Environment
DeepSeek requires Python 3.7+; add Python to the system PATH after installation.
Macbook:GithubCommitSpace Aion$ python --version
Python 3.12.8
Macbook:GithubCommitSpace Aion$2. Download and Install DeepSeek Plugin
Install AI‑Driven Code Assistant from IDEA Marketplace
Open IDEA, go to Settings (Windows/Linux) or IntelliJ IDEA → Preferences (macOS), then select Plugins . Search for CodeGPT , view details, and click Install . Restart IDEA after installation.
Configure DeepSeek
Create and Set API Key
Visit https://www.deepseek.com/ , open the API Open Platform, and create an API key. Enter this key in IDEA under the DeepSeek settings.
Integrate DeepSeek in IDEA
Open the installed CodeGPT settings, locate Custom OpenAI , and configure three sections:
Enter the API key.
Set the chat model URL to https://api.deepseek.com/chat/completions and model name to deepseek-chat .
Enable code completions and parse responses as chat completions, choose the DeepSeek Coder FIM template, and set the inference model URL to https://api.deepseek.com/chat/completions with model deepseek-reasoner .
Apply and confirm the settings.
DeepSeek Configuration Manual
Refer to the official documentation for detailed configuration: https://api-docs.deepseek.com/zh-cn/ .
3. Using DeepSeek for Programming
Generating Ideas and Code
Select the Custom OpenAI component in CodeGPT, enter a prompt such as “Write a Java method to filter numbers and provide tests,” and receive generated code.
public class TestNumberFilter {
public static String filterNumbers(String input) {
// Use regex to keep only digits
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: 1224324
}
}Code Completion
Press Ctrl + Space (or a custom shortcut) to trigger DeepSeek’s context‑aware code completion.
Code Explanation
Select a code block, right‑click, and choose CodeGPT to receive a detailed explanation of its logic.
Problem Solving
Highlight problematic code or describe an issue, then choose CodeGPT: Ask Question to get targeted solutions and suggestions.
4. DeepSeek Usage Statistics
Review token consumption and request counts on the DeepSeek dashboard to monitor monthly usage and associated costs.
Conclusion
By following these steps, you can successfully integrate DeepSeek into IntelliJ IDEA, leveraging its AI capabilities for code generation, completion, explanation, and troubleshooting, thereby enhancing your Java development workflow.
Top Architect
Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn 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.