vscode中的java插件 Language Support for Java by RedHat 正常初始化之后,vscode右下角是這樣的

是一個大拇指的狀態,這時main方法和TestCase方法上都會出現 Run|Debug 快捷鏈接,可以方便的進行測試

terminal中會輸出如下類似信息
9b7c9ae3 Synchronizing projects [Done]
30bb500f Building [Done]
25a21665 Building [Done]
182dd5d5 Refreshing workspace [Done]
28b7d532 Setting classpath containers [Done]
7329fe90 Building [Done]
98cbeb3b Synchronizing projects [Done]
2e750be6 Building [Done]
75d81303 Building [Done]
0b0220d7 Refreshing workspace [Done]
02c5152f Refreshing workspace [Done]
7cece74d Resolve plugin dependency [Done]
1c86063d Building [Done]
a5a3679d Building [Done]
929ba446 Building [Done]
5e357308 Register Watchers [Done]
6b8ee61a Building [Done]
0211f3bb Building [Done]
5417ca59 Building [Done]
6c426d2f Building [Done]
ca8e1582 Building [Done]
有時會出現java插件初始化異常的情況,現象是大拇指位置一直在轉圈,而且沒有任何報錯
這時可以進行如下操作:
- 設置java.trace.server=verbose

設置

- 打開developer tools (打開命令面板后輸入 developer tools)
Plug-in org.eclipse.jdt.ls.core was unable to load class org.eclipse.jdt.ls.core.internal.LanguageServero
然后看到如下報錯:
Plug-in org.eclipse.jdt.ls.core was unable to load class org.eclipse.jdt.ls.core.internal.LanguageServero
有一種方法可以解決,把代碼工程拷貝到其他目錄再打開,原因不詳.
參考:
https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting
