-
Notifications
You must be signed in to change notification settings - Fork 90
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
LSP java server starts and exits immediately #249
Comments
The latest server requires java 11, see eclipse-jdtls/eclipse.jdt.ls#1509 Edit: Solution 1: Upgrade to Java 11.
Delete the server and download it again. |
But I cannot upgrade easily |
check lsp-java-jdt-download-url and this https://projects.eclipse.org/projects/eclipse.jdt.ls/downloads |
It is bound to How may I modify it ? I saw on Many thanks for your help Regards |
Modify it with setq
I guess yes. |
Problem solved by downgrading the It is a pity however that I can no more benefit from the server updates because these one do not maintain a backward compatibility. Probably, Great thanks for your help. Regards |
@deb75 Afaik, the server requires Java 11 only to run. You can compile your code against Java 8 and you can have both versions installed side-by-side. Java 8 is EOL except for companies that pay for support so I assume Eclipse are just upgrading to a supported version to avoid things like security vulnerabilities and to take advantage of new features. |
Thanks for the note ! But how can I tell In my settings I have :
Is |
yes. |
Then, which java version Regards EDIT : according to the wiki (bottom of the page), Am I right ? Regards |
As far as I know (at least of Mac OSX), Eclipse auto-discovers all installed Java versions and I think it will use the correct one depending on the source compatibility version (for compilation) and target compatibility version (for running). @yyoncho will probably know whether this is correct. You can also run a test by trying to use Java 11 features and see what happens. |
Sorry, I am just lost, where do you write the settings "java.configuration.runtimes" ? At my root project, there is a |
I created a file
But it does not seem to work. |
I have seen in
which seems to do exactly what I want to do. How can I configure it so that it points to another jdk ? Regards |
Here it is an example how to use it: (setq lsp-java-configuration-runtimes '[(:name "JavaSE-8"
:path "/home/kyoncho/.java-jdk/"
:default t)]) |
This, together with wiping out the workspace and project settings (not sure if it was necessary) worked 👍 |
I have Java 11, OpenJDK 11.0.10 on Ubuntu 20.04. I configure
However, the JDT server is exiting immediately. I am not sure what changed, it was working till about three days back. What could be the issue here? |
Try to delete lsp-java-workspace-dir |
Thanks, @yyoncho, that worked. Maybe |
Just a heads up, If your main JDK is version 11+ and you want your project to compile for example to jdk 8, and you are using maven or gradle you can set the level the compiler will produce the bytecode, for Maven you can configure the compiler plugin and gradle the |
Hello,
When I load a java file in
emacs
(on windows 10), the LSP server starts and exits immediately :It looks strange for me as it used to work perfectly before I updated all
emacs
packages and the LSP server to their latest versions.I made no changes in the LSP configuration and there are no errors from config when
emacs 26.1
starts itself.I wiped out the workspace directory and the LSP session file, still same behavior. Also, nothing is written in this latest directory by the LSP server starting.
What could help me is to understand what means "code 13" ?
Thanks in advance for your kind help.
Regards
deb75
The text was updated successfully, but these errors were encountered: