2

I have managed to install lsp-java according to their git Readme (https://github.com/emacs-lsp/lsp-java) and created my workspace.

Is there a better way (eg. in form of a documentation or tutorial) to get to known with lsp-java or do I have to try out every single possible command and see what is going to happen?

4
  • Are you already familiar with Emacs? It looks like the package assumes that you are. If you're not, do C-h t for the Emacs tutorial. If you already are, and the README doesn't give you the information you need, it's a good idea to start with C-h m or describe-mode. That should tell you the relevant bindings. From there use C-h f, describe-function. It's convention to name Emacs packages with a prefix. For lsp-java, it's lsp-. Do a C-h f lsp-. If the package is any good, the functions should be intuitive and the docstrings helpful. Feb 20, 2019 at 14:59
  • If you find the package useful, yet the documentation lacking, write up the documentation you would have liked to see (using your hard-won knowledge). Your input is valuable! stackoverflow.com/questions/14680711/… Feb 20, 2019 at 15:01
  • Does googling for "lsp-java" tutorial help?
    – Drew
    Feb 20, 2019 at 21:29
  • 1
    If it helped, I would not have asked here :) I even disabled looking for Liskov's Substitution.
    – topkek
    Feb 20, 2019 at 21:48

2 Answers 2

1

In the github page for lsp-java, there is a wordpress page that runs through an example workflow utilising lsp-java. This could be a good starting point.

1
1

I'm using configure of prelude and install lsp-java recently without much configures:

  1. require lsp-mode, company-lsp, lsp-ui, lsp-java;
  2. add code for hook:
(add-hook 'java-mode-hook #'lsp)
(add-hook 'java-mode-hook 'flycheck-mode)
(add-hook 'java-mode-hook 'company-mode)
  1. create a test java project with git and HelloWorld.java;
  2. restart emacs and open HelloWorld.java by step3, emacs will auto download jdt(you may download it manually);
  3. when everything ready, you should see message like "LSP :: Connected to [jdtls:12693 status:starting]." when you open HelloWorld.java by step 3.

all my configure can find at: https://github.com/RezoChiang/prelude/tree/rezo-lsp/modules

3
  • 1
    Where should you put the downloaded jdt-language-server-latest.tar.gz and how to install it manually? Nov 27, 2019 at 6:06
  • I am also having the same problem. How to install the language server manually
    – Vicky
    Jan 14, 2020 at 9:04
  • sorry for reply sooo late. there should be eclipse.jdt.ls/server under . emacs.d you can put the jdt file to there. Jan 14, 2020 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.