Java Intellij IDEA 无法启动

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31715481/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 11:29:34  来源:igfitidea点击:

Intellij IDEA won't start

javaintellij-idea

提问by Lasitha Konara

When I open Intellij 14 , it starts the initial loading and then following is shown in the screen.After that it is vanished and program does not start.

当我打开 Intellij 14 时,它开始初始加载,然后屏幕上显示以下内容。之后它消失并且程序没有启动。

enter image description here

在此处输入图片说明

But when I open the task manager it is shown in the Processes as per the below figure.

但是当我打开任务管理器时,它显示在进程中,如下图所示。

enter image description here

在此处输入图片说明

Sometimes the program starts after about 10 minutes .Sometimes it won't start at all.Can someone give me a solution on how to overcome this problem ?

有时程序会在大约 10 分钟后启动。有时它根本不会启动。有人可以给我一个如何克服这个问题的解决方案吗?

回答by Tom Murphy

I got an out-of-memory dialog on intellij 15 and took an option on that dialog to increase max memory. Thereafter I could not start intellij. So, I looked in the intellij /bin folder for a pid file (per another stack overflow question) to see what was happening, but I could not find one. There was however a file (idea.exe.vmoptions) that had changed (to hold my new memory setting). So I edited that file to set max memory back to what I had before, and now it works.

我在 intellij 15 上遇到了一个内存不足对话框,并在该对话框上选择了一个选项来增加最大内存。此后我无法启动intellij。因此,我在 intellij /bin 文件夹中查找了 pid 文件(根据另一个堆栈溢出问题)以查看发生了什么,但我找不到。然而,有一个文件 (idea.exe.vmoptions) 已更改(以保存我的新内存设置)。所以我编辑了那个文件,将最大内存设置回我以前的状态,现在它可以工作了。

回答by Vlad Schnakovszki

Just like Tom, I too have increased the memory when IntelliJ asked and regretted it. This is the screen that asked for it:

就像Tom一样,我也增加了IntelliJ问起后悔的时候的记忆。这是要求它的屏幕:

enter image description here

在此处输入图片说明

However, in my case, instead of editing the .vmoptionsfiles in the binfolder, IntelliJ created a new one in my homedirectory which I can only assume overrides the ones in the binfolder. I would assume this is typical of the new versions - I am using IntelliJ 2016.1 right now.

但是,就我而言,IntelliJ没有编辑.vmoptions文件bin夹中的文件,而是在我的home目录中创建了一个新文件,我只能假设它会覆盖bin文件夹中的文件。我认为这是新版本的典型特征——我现在正在使用 IntelliJ 2016.1。

So, in order to fix this issue, go to C:\Users\<your_username>\.IntelliJIdea<version>\config(or your OS' equivalent) and deletethe idea.exe.vmoptionsand/or idea64.exe.vmoptionsfile from there. This should remove the override and have IntelliJ use the settings in the binfolder.

因此,为了解决这个问题,去C:\Users\<your_username>\.IntelliJIdea<version>\config(或你的OS”当量)和删除idea.exe.vmoptions和/或idea64.exe.vmoptions从那里文件。这应该删除覆盖并让 IntelliJ 使用bin文件夹中的设置。

It might be worth checking the files in the binfolder as well, in case IntelliJ changes how it handles these settings.

也可能值得检查文件bin夹中的文件,以防 IntelliJ 更改其处理这些设置的方式。



Here are the default .vmoptionsfiles in the installation's binfolder; you can't delete these as it will prevent IntelliJ from starting:

以下是.vmoptions安装bin文件夹中的默认文件;你不能删除这些,因为它会阻止 IntelliJ 启动:

bin/idea.exe.vmoptions:

bin/idea.exe.vmoptions:

-server
-Xms128m
-Xmx512m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=150m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50

bin/idea64.exe.vmoptions

bin/idea64.exe.vmoptions

-Xms128m
-Xmx750m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=225m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50

回答by Micha? Stochmal

You might also check your IDEA_JDK_64, JAVA_HOME and JDK_HOME environmental variables. In my case I updated Java version and deleted previous directory containing JDK. Then IntelliJ started to dissapear from processes just a few seconds after launch. I changed all paths to point proper JDK directory and then it started to work as it should.

您还可以检查 IDEA_JDK_64、JAVA_HOME 和 JDK_HOME 环境变量。就我而言,我更新了 Java 版本并删除了以前包含 JDK 的目录。然后 IntelliJ 在启动后几秒钟就开始从进程中消失。我更改了所有路径以指向正确的 JDK 目录,然后它开始正常工作。

回答by Kerisnarendra

Edit C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.6\bin\idea.exe.vmoptions the Xmx to Xmx512

编辑 C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.6\bin\idea.exe.vmoptions 将 Xmx 改为 Xmx512

-server
-Xms128m
-Xmx512m

回答by kartick shaw

Check the logs for error or issue in the path C:\Users\.IntelliJIdea14\system\log\idea.log.

检查路径 C:\Users\.IntelliJIdea14\system\log\idea.log 中的错误或问题日志。

If that report HeapDumpOnOutOfMemoryError

如果那个报告HeapDumpOnOutOfMemoryError

Go to VM options files in the path C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.6\bin

转到路径 C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.6\bin 中的 VM 选项文件

Increase the -Xms750mto greater value say -Xms900m.

-Xms750m增加到更大的值,比如-Xms900m

That solve the issue for me

这为我解决了问题

回答by Dulith De Costa

Following steps helped me to overcome the Java heap size related issues on InteliJ IDEA.

以下步骤帮助我克服了 InteliJ IDEA 上与 Java 堆大小相关的问题。

Go to the location where you have installed the IDEA IDE and search for the following file:

转到安装 IDEA IDE 的位置并搜索以下文件:

idea64.exe.vmoptions

Change it accordingly.

相应地更改它。

-Xms4196m
-Xmx8092m
-XX:MaxPermSize=1000m
-XX:ReservedCodeCacheSize=1024m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50

Also be aware of the 32-bitaddress space limit on Windows which makes it hard to use heap sizes higher than 750m. Should you need to use larger heap, make sure to switch to the 64-bit JVMfirst, otherwise IDE may crash on start or start to crash randomly during work.

还要注意32-bitWindows上的地址空间限制,这使得使用大于750m. 如果您需要使用更大的堆,请确保先切换到64 位 JVM,否则 IDE 可能会在启动时崩溃或在工作过程中随机开始崩溃。

回答by Yu Chen

Just updated IntelliJ to a newer version, and I followed the 'configure' link to double the memory used for IntelliJ which I later regret. IntelliJ could not restart. Open the system.log (e.g. Use CMD+SPACE_BAR and search 'console' on MacOs, then go to system.log), I can see IntelliJ aborted a few times with an abnormal code 1. Here the lines related to the launch,

刚刚将 IntelliJ 更新为更新版本,我按照“配置”链接将用于 IntelliJ 的内存增加了一倍,我后来后悔了。IntelliJ 无法重新启动。打开system.log(例如在MacOs上使用CMD+SPACE_BAR并搜索'console',然后转到system.log),我可以看到IntelliJ中止了几次并出现异常代码1。这里是与启动相关的行,

Processing VMOptions file at 
 /Users/[user]/Library/Preferences/IntelliJIdea2019.2/idea.vmoptions
com.apple.xpc.launchd[1] (com.jetbrains.intellij.22016[2971]): Service exited with abnormal code: 1

I can see the path from where IntelliJ loads vm options during the launch. Checking the bin/ of my IntelliJ application, I can see another version of the idea.vmoptions file that has a slightly older timestamp. By comparing the content of the two files, I now realized that IntelliJ created another vm option file that has only a sub set of options in a newer location which broke the restart. Deleting or just safely renaming the newer file in the [User] sub directory fixed my problem.

我可以看到 IntelliJ 在启动期间加载 vm 选项的路径。检查我的 IntelliJ 应用程序的 bin/,我可以看到另一个版本的 idea.vmoptions 文件的时间戳稍旧。通过比较这两个文件的内容,我现在意识到 IntelliJ 创建了另一个 vm 选项文件,该文件在较新的位置只有一组选项,这破坏了重启。删除或只是安全地重命名 [User] 子目录中的较新文件解决了我的问题。

回答by Oguzhan Cevik

You can try to open Intellij on CLI.

您可以尝试在 CLI 上打开 Intellij。

cd C:\Program Files\JetBrains\IntelliJ IDEA 2020.1\bin

later then execute this command

稍后再执行此命令

idea.bat

Probably Intellij will open. If it will not open then you can see the error message why it will not open on CLI.

可能 Intellij 会打开。如果它不会打开,那么您可以看到为什么它不会在 CLI 上打开的错误消息。