问题描述:2021.2启动不了,双击桌面图标,没有响应;CMD里输入idea有报错。
首先进入到idea安装目录,这是我的安装路径 E:\IntelliJ IDEA 2021.2\bin
错误内容
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at fuck_the_regulations_v320.en.b(en.java)
at fuck_the_regulations_v320.dH.premain(dH.java)
... 6 more
Caused by: java.lang.NullPointerException
... 8 more
*** java.lang.instrument ASSERTION FAILED ***: "result" with message agent load/premain call failed at ./src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 422
FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed
1.双击idea.bat文件会一闪而过,为了看清错误log,直接编辑idea.bat文件在最后一行加上以下内容保存
echo %CLASS_PATH%
echo %ACC%
echo %IDE_PROPERTIES_PROPERTY%
echo configfile\%VM_OPTIONS_FILE%
pause
2. 重新双击执行idea.bat(在CMD里哦),发现如下输出
E:\Install\IntelliJ IDEA 2021.3.2\lib\util.jar;E:\Install\IntelliJ IDEA 2021.3.2\lib\bootstrap.jar;\lib\tools.jar
"-Djb.vmOptionsFile=C:\Users\admin\AppData\Roaming\JetBrains\IntelliJIdea2021.3\idea64.exe.vmoptions" "-Xms128m" "-Xmx2048m"
"-XX:ReservedCodeCacheSize=512m"
"-XX:+IgnoreUnrecognizedVMOptions"
"-XX:+UseG1GC"
"-XX:SoftRefLRUPolicyMSPerMB=50"
"-XX:CICompilerCount=2"
"-XX:+HeapDumpOnOutOfMemoryError"
"-XX:-OmitStackTraceInFastThrow"
"-ea"
"-Dsun.io.useCanonCaches=false" "-Djdk.http.auth.tunneling.disabledSchemes=""" "-Djdk.attach.allowAttachSelf=true" "-Djdk.module.illegalAccess.silent=true" "-Dkotlinx.coroutines.debug=off" "-Xmx2031m" "-Djava.net.preferIPv4Stack=true"
"-javaagent:C:\Users\Public\.jetbrains\jetbrains-agent-v3.2.0.de72.619" "-Dfile.encoding=UTF-8" "-Drecreate.x11.input.method=true"
ECHO 处于关闭状态。
configfile\E:\Install\IntelliJ IDEA 2021.3.2\bin\\idea64.exe.vmoptions
那么注意问题来了:
注意打印出来的东西-javaagent这个参数,会发现idea.bat中并没有进行配置这个参数,但打印出来就是有。
找到问题:那么就得注意打印出来的两个地方,一个是-Djb.vmOptionsFile这个参数跟我们打印出来的configfile路径
"Djb.vmOptionsFile=C:\Users\admin\AppData\Roaming\JetBrains\IntelliJIdea2021.3\idea64.exe.vmoptions"
configfile\E:\Install\IntelliJ IDEA 2021.3.2\bin\\idea64.exe.vmoptions
解决问题:打开这两个路径下的idea64.exe.vmoptions文件删除“-javaagent”参数保存,重新双击idea.bat就OK了
参考链接(我是在他的基础上多找到了一些问题-Djb.vmOptionsFile参数):记录一次idea 2021.2启动不了_程序人生-优快云博客_idea2021无法启动