IDEA 启动 Springboot 项目出现 AttachProvider for the vm is not found

IDEA 启动 Springboot 项目出现 AttachProvider for the vm is not found

解决方案一

先说第一个解决方案:
配置出现问题的 Springboot 项目启动参数 VM options 项

-Dcom.sun.management.jmxremote.port={some_port}
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=localhost


端口号是多少无所谓,理论上只要不被占用都行。我的理解是暴露出一个端口号让 IDEA 能够连接上 AttachProvider。

原文:

上面的方法已经可以解决问题了,但由于公司的项目是分布式的,每个子模块都需要配置这样的 VM 参数显得非常麻烦。然而在我询问这位 Support Engineer at JetBrains 出现这种状况的原因时,他给出了这样的答复:

原文:

参考:https://youtrack.jetbrains.com/issue/IDEA-210665

要感谢这位工程师的耐心解答,总之意思大体就是我的 IDEA 和 Springboot 项目没有在同一 JVM 环境下运行,使得 IDEA 不能连接到这个 AttachProvider。

那么反过来,只要让 IDEA 和项目共同运行在同一个 jdk 环境下是不是就可以不需要配置项目的 VM 参数了呢?所以:

另一个解决方案

关于 IDEA 修改 Jetbrains Runtime 方法参考:
http://www.voidcn.com/article/p-fkwgtmms-bvn.html

注意:IDEA 使用 Jetbrains Runtime 作为 JVM 环境,我尝试过使用 Oracle JDK 1.8作为 IDEA 的 JVM 环境,出现了很多例如插件无法正常运行或中文语言包乱码的情况。总之不是非常兼容。所以这里还是使用 intellij-jdk 作为 IDEA 和项目共用的 JVM 环境。

intellij-jdk 下载地址:
https://bintray.com/jetbrains/intellij-jdk/openjdk8-windows-x64#files

这里我选用的是 jbsdk8u202b1483.4_windows_x64.tar.gz

环境变量配置:

我是用 64 位的 IDEA,所以只配 64 位的环境变量。配置完成后重启 IDEA。
项目 JDK 配置(使用 Jetbrains-JDK):
此时的项目参数 VM options:

运行状态:

没有再报 AttachProvider for the vm is not found 了。

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
回答: 当使用IDEA启动Spring Boot项目时,如果出现闪退的情况,可能有几种原因导致。一种可能是因为忘记添加了spring-boot-starter-web依赖,导致项目无法正常启动。你可以在pom文件中添加以下依赖来解决这个问题:\[1\]\[2\] ``` <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <version>2.5.12</version> </dependency> ``` 另一种可能是由于内存问题导致的闪退。你可以尝试增加IDEA的内存限制,找到idea安装目录下的idea64.exe.vmoptions文件,将参数Xmx设置为750或更大,保存后重启IDEA。\[3\] 此外,闪退问题也可能是由于插件导致的,你可以尝试禁用一些插件来解决问题。希望这些解决方法能帮助你解决闪退问题。 #### 引用[.reference_title] - *1* [idea启动Spring项目自动退出](https://blog.csdn.net/SuQingDong7/article/details/129044416)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [springboot 项目启动就闪退(解决方案)](https://blog.csdn.net/weixin_42633131/article/details/83625169)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [IDEA频繁闪退解决](https://blog.csdn.net/qq_49425839/article/details/124872962)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值