lsp-java icon indicating copy to clipboard operation
lsp-java copied to clipboard

"Unable to find single point of entry" after lsp-java-update-server

Open langston-barrett opened this issue 6 years ago • 5 comments

Describe the bug After running lsp-java-update-server for the first time, I now see

File local-variables error: (error Unable to find single point of entry (/home/<user>/.emacs.d/eclipse.jdt.ls/server/plugins/org.eclipse.equinox.launcher_1.5.200.v20180922-1751.jar /home/<user>/.emacs.d/eclipse.jdt.ls/server/plugins/org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar))

when opening a Java file, and no LSP functionality is available.

lsp-java version: 20191003.1532

langston-barrett avatar Oct 11 '19 18:10 langston-barrett

I was able to fix this by removing the server installation entirely:

rm -rf ~/.emacs.d/eclipse.jdt.ls/server/

I was then prompted to install the server, which I did.

langston-barrett avatar Oct 11 '19 18:10 langston-barrett

Got the same issue, removing the folder and restarting fixed it as well.

didibus avatar Oct 16 '19 01:10 didibus

Same issue, remove server/ folder, and execute lsp-java-update-server command fixed issue.

stardiviner avatar Oct 24 '19 02:10 stardiviner

The problem is with this function:

(defun lsp-java--locate-server-jar ()
  "Return the jar file location of the language server.

The entry point of the language server is in `lsp-java-server-install-dir'/plugins/org.eclipse.equinox.launcher_`version'.jar."
  (pcase (f-glob "org.eclipse.equinox.launcher_*.jar" (expand-file-name "plugins" lsp-java-server-install-dir))
    (`(,single-entry) single-entry)
    (`nil nil)
    (server-jar-filenames
     (error "Unable to find single point of entry %s" server-jar-filenames))))

After an upgrade, many files like these coexist, hence confusing the above function:

~ » ll /home/lbolla/.emacs.d/.cache/lsp/eclipse.jdt.ls/plugins/*equinox.launcher_*
-rw-rw-r-- 1 lbolla lbolla 53088 Jul 23 11:45 /home/lbolla/.emacs.d/.cache/lsp/eclipse.jdt.ls/plugins/LB_LEGACY_org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar
-rw-rw-r-- 1 lbolla lbolla 53255 Sep 18 17:58 /home/lbolla/.emacs.d/.cache/lsp/eclipse.jdt.ls/plugins/LB_LEGACY_org.eclipse.equinox.launcher_1.5.800.v20200727-1323.jar
-rw-rw-r-- 1 lbolla lbolla 53322 Nov 20 17:38 /home/lbolla/.emacs.d/.cache/lsp/eclipse.jdt.ls/plugins/org.eclipse.equinox.launcher_1.6.0.v20200915-1508.jar

I had to rename the old ones above prepending the "LB_LEGACY_" to make it work.

Ideally, the function above should ignore the old entries and just pick up the latest available. Alternatively, cleaning up the whole installation before an upgrade seems a viable brute force solution.

lbolla avatar Nov 24 '20 08:11 lbolla

@lbolla the bug is that we don't delete the old one, ATM you should delete the server and install it again otherwise you are risking random issues.

yyoncho avatar Nov 24 '20 09:11 yyoncho