How to Seamlessly Integrate DeepSeek AI into IntelliJ IDEA for Java Development
This step‑by‑step guide shows Java developers how to prepare their environment, install the CodeGPT plugin, configure DeepSeek with an API key and model settings, and then use the assistant for code generation, completion, explanation, question answering, and usage monitoring within IntelliJ IDEA.
Preparation
Ensure you are running IntelliJ IDEA 2023.x or newer and have Python 3.7+ installed and added to the system PATH, because the DeepSeek assistant runs on a Python backend.
python --versionInstall the CodeGPT Plugin
Open IDEA, go to File → Settings (Windows/Linux) or IntelliJ IDEA → Preferences (macOS).
Select Plugins → Marketplace and search for CodeGPT.
Click Install and restart IDEA when prompted.
Configure DeepSeek
Create an API Key
Visit https://www.deepseek.com/, open the API Open Platform, and generate a new API key.
Set Up DeepSeek in IDEA
In IDEA, open the CodeGPT settings, choose Custom OpenAI, and fill in the following fields:
API Key – paste the key created in the previous step.
Chat model – set the URL to https://api.deepseek.com/chat/completions and the model name to deepseek-chat.
Inference model – use the same URL, set the model name to deepseek-reasoner, enable Enable code completions and Parse response as Chat Completions, and choose the FIM template DeepSeek Coder.
Using DeepSeek
Generate Code
Open the CodeGPT panel, select Custom OpenAI, and type a prompt such as “Write a Java method to filter numbers and provide a test”. DeepSeek returns the following code:
public class TestNumberFilter {
public static String filterNumbers(String input) {
// Use regex to keep digits only
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 code, press Ctrl + Space (or your custom shortcut). DeepSeek analyses the surrounding context and suggests the next tokens, dramatically speeding up coding.
Code Explanation
Select a code fragment, right‑click, choose CodeGPT → Explain. DeepSeek returns a natural‑language description of the logic and purpose of the selected code.
Ask Questions
Highlight code or write a problem description, then choose CodeGPT: Ask Question. The assistant provides targeted solutions, debugging tips, or alternative implementations.
Usage Statistics
DeepSeek usage can be monitored on the official dashboard; it shows daily token consumption, request counts, and the corresponding cost, helping you stay within quota.
Conclusion
By following these steps you integrate DeepSeek into IntelliJ IDEA, gaining AI‑driven code generation, completion, explanation, and troubleshooting capabilities that boost Java development productivity.
Java Web Project
Focused on Java backend technologies, trending internet tech, and the latest industry developments. The platform serves over 200,000 Java developers, inviting you to learn and exchange ideas together. Check the menu for Java learning resources.
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.
