How to Speed Up IntelliJ IDEA: 10 Essential Fixes

This article lists ten common IntelliJ IDEA problems—from sluggish performance and Lombok errors to Git commit issues and MySQL connection failures—and provides concrete configuration steps, code snippets, and best‑practice recommendations to resolve each pitfall for Java developers.

IT Services Circle
IT Services Circle
IT Services Circle
How to Speed Up IntelliJ IDEA: 10 Essential Fixes

Introduction

IntelliJ IDEA is a powerful IDE for Java development, but many developers encounter recurring issues that degrade productivity. This guide collects ten classic "pits" and explains why they happen and how to fix them.

1. IDEA Becomes Slow After Hours

Symptom: After a few hours of use the IDE lags, mouse cursor spins, and CPU hits 100%.

Cause: Insufficient heap memory (default 512 MB–1 GB) and frequent re‑indexing of large directories such as node_modules.

Solution:

Increase heap size in idea64.exe.vmoptions (or /Applications/IntelliJ IDEA.app/Contents/bin/idea.vmoptions) to:

# Recommended for an 8 GB machine
-Xms2048m
-Xmx4096m
-XX:ReservedCodeCacheSize=512m
-XX:+UseG1GC
-XX:+UseStringDeduplication

Exclude unnecessary folders ( node_modules, .git, target, build) via File → Settings → Project Structure → Modules → Excluded .

2. Lombok Annotations Show Errors

Symptom: Methods annotated with @Data or @Getter appear red and compilation fails.

Cause: Lombok plugin missing or annotation processing disabled.

Solution:

Install and enable the Lombok plugin ( File → Settings → Plugins → Lombok ).

Enable annotation processing ( File → Settings → Build, Execution, Deployment → Compiler → Annotation Processors → Enable annotation processing ).

Ensure the Lombok dependency version is up‑to‑date, e.g. 1.18.30 in pom.xml or build.gradle.

3. Debugger Breakpoints Do Not Hit

Symptom: Breakpoints are ignored or appear with a gray check‑mark.

Cause: Breakpoint placed on non‑executable code, disabled breakpoint, or JIT inlining.

Solution:

Make sure the breakpoint is on an executable line (e.g., inside the method body, not on the signature).

Check that the breakpoint is enabled (no slash on the icon) via Ctrl+Shift+F8.

If using conditional breakpoints, verify the condition evaluates to true.

Use Thread.currentThread().getStackTrace() or logs for complex multithreaded cases.

4. Console Shows Chinese Garbled Text

Symptom: Console output displays ??? or \uXXXX instead of Chinese characters.

Cause: Mismatched encodings among source files, IDE console, JVM, and OS.

Solution:

Set all encodings to UTF‑8 via File → Settings → Editor → File Encodings (Global, Project, and properties file encoding).

Add JVM options: -Dfile.encoding=UTF-8 and -Dconsole.encoding=UTF-8 in Help → Edit Custom VM Options .

Configure Maven project.build.sourceEncoding and project.reporting.outputEncoding to UTF‑8.

5. Unwanted .idea Files in Git Commits

Symptom: Files like .idea/workspace.xml or target/ appear in the commit dialog.

Cause: No .gitignore or IDEA not respecting it.

Solution:

Create a .gitignore at the project root with entries for .idea/, *.iml, target/, etc.

In IDEA, go to Settings → Version Control → Ignored Files and ensure the rules are applied.

If the files were already committed, run:

git rm -r --cached .idea
git commit -m "Remove .idea from git"

6. Maven Dependency Download Is Very Slow

Symptom: Refreshing Maven projects hangs or times out.

Cause: Maven uses the remote central repository without a local mirror.

Solution:

Add a mirror to settings.xml, e.g. Alibaba Cloud:

<mirrors>
  <mirror>
    <id>aliyunmaven</id>
    <mirrorOf>central</mirrorOf>
    <name>Alibaba Cloud Maven</name>
    <url>https://maven.aliyun.com/repository/public</url>
  </mirror>
</mirrors>

Disable "Work offline" and enable "Import Maven projects automatically" in IDEA settings.

Configure HTTP proxy if needed.

7. Code Compiles but Runtime Throws ClassNotFoundException

Symptom: java.lang.ClassNotFoundException occurs when running the application.

Cause: IDEA’s output directory differs from Maven’s target/classes or annotation processing failed.

Solution:

Ensure File → Settings → Build, Execution, Deployment → Compiler → Build project automatically is checked.

Verify each module’s Output path and Test output path point to target/classes and target/test-classes.

Perform Build → Rebuild Project or File → Invalidate Caches / Restart .

8. Shortcut Keys Stop Working

Symptom: Common shortcuts like Ctrl+C, Ctrl+V, or Ctrl+Alt+L no longer work or trigger other actions.

Cause: Conflict with other applications (e.g., WeChat, Sogou) or accidental keymap change.

Solution:

Open File → Settings → Keymap and restore the default keymap.

Disable or reassign conflicting shortcuts in external software.

Search for the specific action in the keymap and resolve duplicate assignments.

9. MySQL Connection Fails in IDEA Database Tool

Symptom: Errors like The server time zone value '???' is unrecognized or Could not create connection to database server.

Cause: MySQL 8+ requires the serverTimezone parameter.

Solution: In the Data Source Advanced tab add:

Name: serverTimezone
Value: Asia/Shanghai

Or append to the JDBC URL:

jdbc:mysql://localhost:3306/test?useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf-8

10. Automatic Code Reformat on Commit Changes Whole Files

Symptom: Submitting a single line results in a diff that shows the entire file reformatted.

Cause: IDEA’s "Reformat code before commit" feature applies a different style than teammates.

Solution:

Adopt a shared .editorconfig at the project root to enforce consistent formatting.

# .editorconfig
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.java]
indent_size = 4
[*.xml]
indent_size = 2

Or disable automatic formatting via File → Settings → Version Control → Commit and uncheck "Reformat code", "Optimize imports", and "Rearrange code".

Conclusion

IntelliJ IDEA can dramatically boost Java development efficiency, but only when it is properly tuned. By applying the ten fixes above—adjusting memory, managing indexes, configuring Lombok, fixing encoding, cleaning Git history, using Maven mirrors, aligning output paths, resolving shortcut conflicts, setting MySQL time zones, and standardizing code style—developers can avoid common pitfalls and keep the IDE running smoothly.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DebuggingJavaEncodingGitMavenIntelliJ IDEACode formattingIDE performance
IT Services Circle
Written by

IT Services Circle

Delivering cutting-edge internet insights and practical learning resources. We're a passionate and principled IT media platform.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.