あるSEのつぶやき・改

ITやシステム開発などの技術に関する話題を、取り上げたりしています。

VS CodeのSpring Bootで起動エラー「Build failed, do you want to continue?」

VS Code で Spring Boot のプロジェクトを起動しようとすると、「Build failed, do you want to continue?」というエラーメッセージが表示されて起動されない問題が起きました。

f:id:fnyablog:20190728163301p:plain:w480

なんでも、Java Language Server が workspace を捕まえているみたいです。

解決方法は、VS Code 上で [F1]キーを押して表示されるメニューから「Java: Open Java Language Server log file」を選択します。

f:id:fnyablog:20190728163519p:plain:w480

開いたファイルで「Command-line arguments」を検索すると、以下のような行がヒットします。

Command-line arguments: -data /Users/xxxxx/Library/Application Support/Code/User/workspaceStorage/54b318e616d9c7af7b058e871b03b88e/redhat.java/jdt_ws

この54b318e616d9c7af7b058e871b03b88eフォルダを削除します。

$ cd "/Users/xxxxx/Library/Application Support/Code/User/workspaceStorage/"
$ rm -rf 54b318e616d9c7af7b058e871b03b88e

VS Code を再起動して、Spring Boot を再度起動すると成功しました!

f:id:fnyablog:20190728163815p:plain:w480

以下のエラーが表示されるときは、workspaceStorageフォルダを削除すると問題が解消しました。

The Language Support for Java server crashed 5 times in the last 3 minutes.