Other than the general diagnostics, there are Language Support for Java (Eclipse JDT Language Server) plug-in actions that the user can perform.
Verifying the state of the Eclipse JDT Language Server
Check if the container running the Eclipse JDT Language Server plug-in is running the Eclipse JDT Language Server main process.
-
Open a terminal in the container that is running the Eclipse JDT Language Server plug-in (an example name for the container:
vscode-javaxxx). -
Inside the terminal, run the
ps aux | grep jdtcommand to check if the Eclipse JDT Language Server process is running in the container. If the process is running, the output should be:usr/lib/jvm/default-jvm/bin/java --add-modules=ALL-SYSTEM --add-opens java.base/java.util
This message also shows the VSCode java extension used. If it is not running, the language server has not been started inside the container.
-
Check all logs described in Checking important logs
Verifying the Eclipse JDT Language Server features
If the Eclipse JDT Language Server process is running, check if the language server features are working:
-
Open a Java file and use the hover or autocomplete functionality. In case of an erroneous file, the user sees Java in the Outline view or in the Problems view.
Viewing the Java language server log
The Eclipse JDT Language Server has its own workspace where it logs errors, information about executed commands, and events.
-
To open this log file, open a terminal in the container that is running the Eclipse JDT Language Server plug-in. You can also view the log file by running the Java: Open Java Language Server log file command.
-
Run
cat <PATH_TO_LOG_FILE>wherePATH_TO_LOG_FILEis/home/theia/.theia/workspace-storage/<workspace_name>/redhat.java/jdt_ws/.metadata/.log.
Logging the Java language server protocol (LSP) messages
To log the LSP messages to the VS Code Output view, enable tracing by setting the java.trace.server attribute to verbose.
For troubleshooting instructions, see the VS Code Java Github repository.