Skip to content
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

Multiple workspaces with separated config/cache directories #425

Open
dschrempf opened this issue Mar 13, 2023 · 6 comments
Open

Multiple workspaces with separated config/cache directories #425

dschrempf opened this issue Mar 13, 2023 · 6 comments

Comments

@dschrempf
Copy link

Hi!

I am used to running separate language servers for separate projects (==workspaces in jdtls language?) in one Emacs session. Is this possible with lsp-java and jdtls? I can configure lsp-java to load one workspace, then restart Emacs (and kill all remaining java daemons/processes), then load another workspace.

However, when I load two workspaces in one Emacs session the newly loaded workspace is added to the other jdtls instance, instead of running a new instance.

Is it possible to have serparate jdtls instances serving separate workspaces at the same time?

Thank you for your help.

@yyoncho
Copy link
Member

yyoncho commented Mar 13, 2023

At this point, this is not possible, because lsp-java, dap-java are expecting a single jdtls instance.

@dschrempf
Copy link
Author

Thank you for your reply. So how would one then work with two projects and different Java installations? I read something about lsp-save-vscode-workspace but I have no idea how this works.

@yyoncho
Copy link
Member

yyoncho commented Mar 13, 2023

you mean different java versions? IOW what is the problem you are trying to solve

@dschrempf
Copy link
Author

I am trying to develop projects with different versions of jdtls and different versions of the jdk in the same Emacs session.

@yyoncho
Copy link
Member

yyoncho commented Mar 14, 2023

The different versions of the jdk can be controlled by #254 (comment)

Why do you need different jdtls versions?

@dschrempf
Copy link
Author

Thanks for your replies! The links are really informative, and the suggestions worked. I think this should be documented in the project readme but I understand that this is a lot of work.

The only worry I still have is that all projects use the same -configurtion and -data directories (as well as the same lsp-java-workspace-cache-dir). jdtls recommends having separate folders. See, e.g., https://github.com/eclipse/eclipse.jdt.ls#running-from-the-command-line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants