最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】VSCode中调试java报错:Build failed do you want to continue

Java crifan 4087浏览 0评论
对于此处junit的类,去点击 Debug Test,结果还是报错:
之前就遇到:结果右下角提示错误:
Build failed, do you want to continue?
点击Proceed
问题依旧。
再去调试:
Build failed, do you want to continue?
来源:debugger for java(扩展)
点击fix
之前试过了:点击clean cache
Are you sure you want to clean the Java language server workspace?
restart and delete
点击了 Fix,选:
Update project configuration
试试:
然后,终端底部问题好像变化了一下,然后就没有然后了:
再去试试,问题依旧。
抽空再去看看如何解决。
点击 Troubleshooting guide,打开
vscode-java-debug/Troubleshooting.md at master · microsoft/vscode-java-debug · GitHub
去看看log
Open log file
/Users/crifan/Library/Application Support/Code/User/workspaceStorage/e65a81e7e256ecd13e33dbd011d808a5/redhat.java/jdt_ws/.metadata/.log
!ENTRY org.eclipse.jdt.ls.core 1 0 2020-01-10 20:46:03.183
!MESSAGE >> document/codeAction
!ENTRY org.eclipse.jdt.ls.core 1 0 2020-01-10 20:46:03.184
!MESSAGE >> workspace/executeCommand java.resolvePath
!ENTRY org.eclipse.jdt.ls.core 1 0 2020-01-10 20:46:03.363
!MESSAGE >> document/foldingRange
!ENTRY org.eclipse.jdt.ls.core 1 0 2020-01-10 20:46:03.381
!MESSAGE >> document/hover
!ENTRY org.eclipse.jdt.ls.core 1 0 2020-01-10 20:46:03.384
!MESSAGE >> java/findLinks
!ENTRY org.eclipse.jdt.ls.core 1 0 2020-01-10 20:46:03.431
!MESSAGE >> workspace/executeCommand vscode.java.test.search.codelens
!ENTRY org.eclipse.jdt.ls.core 1 0 2020-01-10 20:46:03.431
!MESSAGE >> workspace/executeCommand vscode.java.resolveMainMethod
!ENTRY org.eclipse.jdt.ls.core 1 0 2020-01-10 20:46:03.433
!MESSAGE >> document/codeAction
!ENTRY org.eclipse.jdt.ls.core 1 0 2020-01-10 20:46:04.351
!MESSAGE >> document/documentHighlight
!ENTRY org.eclipse.jdt.ls.core 1 0 2020-01-10 20:46:04.599
!MESSAGE >> document/codeAction
!ENTRY org.eclipse.jdt.ls.core 1 0 2020-01-10 20:46:04.853
!MESSAGE >> java/buildWorkspace (incremental)
!ENTRY org.eclipse.jdt.ls.core 4 0 2020-01-10 20:46:04.859

!MESSAGE Error occured while building workspace. Details: 
 message: '<>' operator is not allowed for source level below 1.7; code: 16778099; resource: /Users/crifan/dev/dev_root/projects/xxx/src/refer/java/iec_analysis/src/main/java/com/iec/assemble101/ContinuousAddressBuilder.java; line: 48
 message: Lambda expressions are allowed only at source level 1.8 or above; code: 1610613381; resource: /Users/crifan/dev/dev_root/projects/xxx/src/refer/java/iec_analysis/src/main/java/com/iec/assemble101/ContinuousAddressBuilder.java; line: 138
 message: Lambda expressions are allowed only at source level 1.8 or above; code: 1610613381; resource: /Users/crifan/dev/dev_root/projects/xxx/src/refer/java/iec_analysis/src/main/java/com/iec/assemble101/UnContinuousAddressBuilder.java; line: 107
 message: '<>' operator is not allowed for source level below 1.7; code: 16778099; resource: /Users/crifan/dev/dev_root/projects/xxx/src/refer/java/iec_analysis/src/main/java/com/iec/assemble101/UnContinuousAddressBuilder.java; line: 55
 message: Lambda expressions are allowed only at source level 1.8 or above; code: 1610613381; resource: /Users/crifan/dev/dev_root/projects/xxx/src/refer/java/iec_analysis/src/main/java/com/iec/assemble104/ContinuousAddressBuilder.java; line: 89
 message: Lambda expressions are allowed only at source level 1.8 or above; code: 1610613381; resource: /Users/crifan/dev/dev_root/projects/xxx/src/refer/java/iec_analysis/src/main/java/com/iec/assemble104/ContinuousAddressBuilder.java; line: 94
 message: Lambda expressions are allowed only at source level 1.8 or above; code: 1610613381; resource: /Users/crifan/dev/dev_root/projects/xxx/src/refer/java/iec_analysis/src/main/java/com/iec/assemble104/ContinuousAddressBuilder.java; line: 113
 message: Cannot refer to the non-final local variable builder defined in an enclosing scope; code: 536870937; resource: /Users/crifan/dev/dev_root/projects/xxx/src/refer/java/iec_analysis/src/main/java/com/iec/assemble104/ContinuousAddressBuilder.java; line: 113
 message: Cannot refer to the non-final local variable fun defined in an enclosing scope; code: 536870937; resource: /Users/crifan/dev/dev_root/projects/xxx/src/refer/java/iec_analysis/src/main/java/com/iec/assemble104/ContinuousAddressBuilder.java; line: 113
 message: Lambda expressions are allowed only at source level 1.8 or above; code: 1610613381; resource: /Users/crifan/dev/dev_root/projects/xxx/src/refer/java/iec_analysis/src/main/java/com/iec/assemble104/ContinuousAddressBuilder.java; line: 84
 message: Lambda expressions are allowed only at source level 1.8 or above; code: 1610613381; resource: /Users/crifan/dev/dev_root/projects/xxx/src/refer/java/iec_analysis/src/main/java/com/iec/assemble104/UnContinuousAddressBuilder.java; line: 101
 message: Lambda expressions are allowed only at source level 1.8 or above; code: 1610613381; resource: /Users/crifan/dev/dev_root/projects/xxx/src/refer/java/iec_analysis/src/main/java/com/iec/assemble104/UnContinuousAddressBuilder.java; line: 106
 message: Lambda expressions are allowed only at source level 1.8 or above; code: 1610613381; resource: /Users/crifan/dev/dev_root/projects/xxx/src/refer/java/iec_analysis/src/main/java/com/iec/assemble104/UnContinuousAddressBuilder.java; line: 111
 message: '<>' operator is not allowed for source level below 1.7; code: 16778099; resource: /Users/crifan/dev/dev_root/projects/xxx/src/refer/java/iec_analysis/src/test/java/com/iec/test/Analysis101Test.java; line: 124
 message: '<>' operator is not allowed for source level below 1.7; code: 16778099; resource: /Users/crifan/dev/dev_root/projects/xxx/src/refer/java/iec_analysis/src/test/java/com/iec/test/Analysis104Test.java; line: 97

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-01-10 20:46:06.985
!MESSAGE >> workspace/executeCommand vscode.java.resolveBuildFiles

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-01-10 20:46:08.256
!MESSAGE >> workspace/executeCommand java.resolvePath
去解决:
【已解决】VSCode调试java报错:message: ‘<>’ operator is not allowed for source level below 1.7
然后继续解决其他的问题:
【已解决】Java代码警告:The serializable class does not declare a static final serialVersionUID field of type long
以及:
【已解决】VSCode中java代码警告:The static method from the type should be accessed in a static way
以及:
【已解决】VSCode中java代码警告:is a raw type References to generic type should be parameterized
解决了所有的error和warning后,再去点击 Debug Test 即可正常调试,没有此处提示了
【总结】
此处,点击(Debug Test)去开启调试,之前弹框提示:
Build failed, do you want to continue?
是因为,代码中有(各种)error(和其他很多warning警告)
在依次解决了代码的error(和顺带也解决了warning)后,即可正常调试,不会有这个弹框提示了。

转载请注明:在路上 » 【已解决】VSCode中调试java报错:Build failed do you want to continue

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.198 seconds, using 22.07MB memory