Skip to content

Java Extension Pack installs but does not work properly #444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kliu128 opened this issue Apr 5, 2019 · 22 comments
Closed

Java Extension Pack installs but does not work properly #444

kliu128 opened this issue Apr 5, 2019 · 22 comments
Labels
bug Something isn't working

Comments

@kliu128
Copy link

kliu128 commented Apr 5, 2019

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.
@nol166
Copy link
Contributor

nol166 commented Apr 5, 2019

@foresthoffman

@kylecarbs
Copy link
Member

kylecarbs commented Apr 6, 2019

Will fix. Thanks for the report!

@abl
Copy link

abl commented Apr 7, 2019

I've tried similar things.

Of possible note, installing the Java Extension Pack on native VS Code also installs other extensions named in the pack; I notice that neither my coder.com instance nor my self-hosted show that the following are installed:

Unfortunately even after installing those (and OpenJDK 11, and maven) I'm unable to get any of the Java features to work.

@ksemba
Copy link

ksemba commented Apr 8, 2019

same issue here - cannot get that pack to work

@adrianliechti
Copy link

i was able to start, debug & run tests a spring app...
have a look at this Dockerfile: https://github.com/monostream/code-server/blob/develop/Dockerfile

the extension is installed before code-server starts - maybe this is the key that this puppy works.

else, try to open the command prompt (Keyboard Shortcut: ⇧⌘P (Windows, Linux Ctrl+Shift+P)) and type Reload Window (vscode restarts and the extenions are reloaded/installed)

@ksemba
Copy link

ksemba commented Apr 11, 2019

Hi @adrianliechti - thanks for sharing this impressive Dockerfile! cool work! I will give it a try later.

I have the RedHat Java extension installed her:
/root/.local/share/code-server/extensions/redhat.java-0.43.0/
[yes, I run code-server as root - this is for testing this "new way" of developing on an internal VM]

And I restart code-server every day so that cannot be the root cause as well.

@ksemba
Copy link

ksemba commented Apr 11, 2019

I tried to run code-server as a non-root user. I had to re-install the Java extension pack, I stopped code-server, restarted, logged in again but still it doesn't work. To tell whether it works or not I did two simple tests within an existing (and working) Java source code file:

  1. Try to see if code completion works by typing this(dot) --> nothing happens, the code editor doesn't show the available properties of that class
  2. Try to see if syntax errors are shown - they are not. Even when I do a mvn install and maven shows compilation errors, they are not shown by the editor within the java file.

My JAVA_HOME is set to /usr/lib/jvm/java-8-openjdk-amd64 which should be correct. I did not edit any vscode settings like java.home.

@adrianliechti
Copy link

adrianliechti commented Apr 11, 2019

13532D52-4E2D-4E7D-9BA0-CCB58404F606

I tried the same (on my ipad...) and as you see, code completion and syntax errors are shown... strange.

(ubuntu, java 10, extensions from official marketplace)

@nol166 nol166 added the bug Something isn't working label Apr 11, 2019
@ksemba
Copy link

ksemba commented Apr 11, 2019

I see this error when I connect to code-server using my browser:

ERROR SHARED stderr {"data":"Uncaught Exception: Error: ENOENT: no such file or directory, open '/home/kurt/.local/share/code-server/Backups/workspaces.json'\n\nError: ENOENT: no such file or directory, open '/home/kurt/.local/share/code-server/Backups/workspaces.json'\n at Timeout.setTimeout [as _onTimeout] (/home/travis/build/codercom/code-server/packages/server/build/bootstrap-fork.js.gz:52540:31)\n at ontimeout (timers.js:498:11)\n at tryOnTimeout (timers.js:323:5)\n at Timer.listOnTimeout (timers.js:290:5)\n"}

not sure if this has anything to do with this

@foresthoffman
Copy link
Contributor

@ksemba The workspaces.json error is unrelated.

@nyxcharon
Copy link

nyxcharon commented Apr 11, 2019

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.

@ksemba
Copy link

ksemba commented Apr 11, 2019

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

@mai1015
Copy link

mai1015 commented Apr 15, 2019

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

@jrussellsmyth
Copy link

jrussellsmyth commented Apr 24, 2019

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!

@alevinetx
Copy link

alevinetx commented Jun 22, 2019

A follow up/me too:
the Java Extension pack (0.7.1) still fails to fully install the wrapped extensions (some parts are install, other pieces go missing). Even downloading the vsix for the extension pack doesn't fully install. Installing them singularly (via VSIX) appears to resolve the problem.

Is this particular to them being MS components, or the wrapping extension? Is there something I need to do on my side to enable this "custom marketplace", or is that there already by default?

re: some parts:
eg: vcsjava.vscode-java-dependency 0.4.0: some of the package is present in the extensions folder, but key pieces like "server/com.microsoft.jdtls.ext.core-0.4.0.jar" are not present. This presents itself in the LS log, stating it cannot find many things.

@angieduong
Copy link

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.

@sr229
Copy link
Contributor

sr229 commented Sep 12, 2019

Hey all, try out v2 in Releases. I think we fixed this one.

@reotam5
Copy link

reotam5 commented Sep 13, 2019

@sr229 what exactly the solution here?

@sr229
Copy link
Contributor

sr229 commented Sep 14, 2019

@reotam5 Explanation in GH-857. It seems someone reports the Java pack works fine at GH-961 now so I'll close this off as well.

@sr229 sr229 closed this as completed Sep 14, 2019
@coloal
Copy link

coloal commented Dec 14, 2020

Did you find any solution to this? I have the exact same problem and can't get what's wrong.

@code-asher
Copy link
Member

@coloal It's possible the extension has broken again, please feel free to open a new issue and fill in the details and we'll take a look.

@ShusenTang
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests