IDEA启动应用时报错,详细错误消息如下:
C:\devel\jdk1.8.0_201\bin\java.exe -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:65267,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-Dmanagement.endpoints.jmx.exposure.include=*" -javaagent:C:\Users\03451J672\AppData\Local\JetBrains\IntelliJIdea2023.2\groovyHotSwap\gragent.jar -javaagent:C:\Users\03451J672\AppData\Local\JetBrains\IntelliJIdea2023.2\captureAgent\debugger-agent.jar=file:/C:/Users/03451J672/AppData/Local/Temp/capture4.props -Dfile.encoding=UTF-8 @C:\Users\03451J672\AppData\Local\Temp\idea_arg_file2001829779 com.ibm.banking.musemvp.parameter.ParameterApplication
Connected to the target VM, address: '127.0.0.1:65267', transport: 'socket'
错误: 找不到或无法加载主类 @C:\Users\03451J672\AppData\Local\Temp\idea_arg_file2001829779
Disconnected from the target VM, address: '127.0.0.1:65267', transport: 'socket'
Process finished with exit code 1
重新编译也不能解决问题,各种尝试,终于找到解决办法如下:
到run/debug configurations里,把对应的应用Shorten command lines由none改成JAR manifest,如图: