启动IntelliJ IDEA失败求助:Failed to create JVM错误代码-1
Hey there, sorry to hear you're hitting this frustrating JVM error when launching IntelliJ IDEA—especially since Eclipse runs fine, that makes this extra head-scratching. Let’s work through some targeted fixes that usually resolve this issue:
Override VM options directly in IntelliJ's config file
Since Eclipse works, your system JDK is likely solid—so the problem might be in IntelliJ's own VM settings conflicting with your environment variable. Here's what to do:- Navigate to your IntelliJ config folder:
- Windows:
%USERPROFILE%\.IntelliJIdea<your-version>\config - Mac:
~/Library/Application Support/JetBrains/IntelliJIdea<your-version> - Linux:
~/.config/JetBrains/IntelliJIdea<your-version>
- Windows:
- Open the
idea64.exe.vmoptionsfile (for 64-bit IDEs, which you’re using) with a plain text editor. - Tweak these critical settings:
- Lower the maximum heap size (
-Xmx) if it’s set too high. For example, if you have 8GB of RAM, switch from-Xmx8gto-Xmx4g—overallocating memory often causes this JVM failure. - If you’re using JDK 17 or newer, add this line to bypass module access restrictions:
--add-opens java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED
- Lower the maximum heap size (
- Save the file and try launching IDEA again.
- Navigate to your IntelliJ config folder:
Double-check your IDEA_JDK_64 environment variable
Even though you added it, typos or incorrect paths can sneak in:- Open Command Prompt (Windows) or Terminal (Mac/Linux).
- Run
echo %IDEA_JDK_64%(Windows) orecho $IDEA_JDK_64(Mac/Linux) to confirm the path. - Ensure it points to a valid 64-bit JDK (not JRE)—for example,
C:\Program Files\Java\jdk-17.0.9. - Pro tip: Steal the working JDK path from Eclipse! Check Eclipse’s
eclipse.inifile for the-vmline to get a guaranteed valid path.
Reset corrupted cache or disable problematic plugins
Corrupted cache or incompatible plugins can block the JVM from starting. Try launching in safe mode first:- Navigate to IntelliJ’s bin folder (e.g.,
C:\Program Files\JetBrains\IntelliJ IDEA <version>\binon Windows). - Run
idea64.exe --safe-mode(Windows) or./idea.sh --safe-mode(Mac/Linux).
If IDEA launches successfully here, a plugin is the culprit. Head toFile > Settings > Pluginsto disable recently installed/updated plugins, then restart normally.
If safe mode fails, delete the cache folder:
- Windows:
%USERPROFILE%\.IntelliJIdea<your-version>\system\caches - Mac:
~/Library/Caches/JetBrains/IntelliJIdea<your-version> - Linux:
~/.cache/JetBrains/IntelliJIdea<your-version>
- Navigate to IntelliJ’s bin folder (e.g.,
Rule out system-wide conflicts
Sometimes third-party software interferes with JVM launch:- Temporarily disable your antivirus/firewall and try launching IDEA.
- Kill any stuck Java processes running in the background (use Task Manager on Windows, Activity Monitor on Mac, or
ps aux | grep javaon Linux to identify and terminate them).
If none of these fixes work, you could try a clean reinstall of IntelliJ IDEA—just make sure to back up your settings via File > Export Settings if you can access the IDE in safe mode first.
内容的提问来源于stack exchange,提问作者Steeve

