code-server: Java Extension Pack installs but does not work properly

Description

When opening a Java file after installing the Java Extension Pack, the syntax highlighting works, but nothing else does - I don’t get the rocket as described on https://code.visualstudio.com/docs/java/java-tutorial.

I have verified that the same setup works on desktop (Linux) VS Code.

I have installed OpenJDK 11 inside the coder container.

Steps to Reproduce

  1. Install the Java Extension Pack from the marketplace
  2. Try opening any Java file. See that no syntax errors or info is shown.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 22 (6 by maintainers)

Most upvoted comments

I had the same issue. I.e. just syntax highlighting and nothing else worked. Eventually, I did Ctrl+Shif+P -> Java: Clean the Java language server workspace. Everything started working. I have a project: simple main class with static main in subpackage + gradle wrapper + maven folders structure.

Will fix. Thanks for the report!

I had the same issue. I.e. just syntax highlighting and nothing else worked. Eventually, I did Ctrl+Shif+P -> Java: Clean the Java language server workspace. Everything started working. I have a project: simple main class with static main in subpackage + gradle wrapper + maven folders structure.

It works for me, thanks!

I did some experimenting with this using both the stock Coder image and the Dockerfile @adrianliechti posted above. There seems to be a couple separate problems to make this all work.

  1. The extensions have to be installed before code-server is started.
  2. Installing the Java Extension Pack doesn’t install all the related plugins, but installing each individually is fine.
  3. You have to have a recent up to date version of gradle/mvn/etc for the plugins to work correctly as well as make the Language Support for Java(TM) by Red Hat) plugin happy.

After installing the plugins manually as per the Dockerfile above, I was still not able to get code completion. However at this point I was getting errors from the Language Support for Java(TM) by Red Hat plugin. After solving these (in my case upgrading the gradle in my project from 2.4 to 5.1) I was able to get code completion.

I ran into this issue also, and the above discussion pretty much points to the reason some work, some dont.

The specific plugins and order of install are not the issue, it appears to be installing from microsoft sources (aka @andrianliechti Dockerfile example) or from Coder’s marketplace (using code-server --install-extension or the in-app marketplace)

My guess is something is off in the coder copy.

also, hats off to @andrianliechti awesome work on that Dockerfile! Definitely stealing some ideas there!

I had try install both Java Extension Pack and Language Support for Java(TM) by Red Hat but it still do not work. When I try any command and it shows command 'java.open.serverLog' not found So, basically I cannot get anything work so far. I am using version 1.792-vsc1.33.1

Thanks @nyxcharon - manually installing the Java extension according to @adrianliechti 's Dockerfile and restarting code-server worked!! Thank you all!