eclipse-jdtls / eclipse.jdt.ls

Java language server
1.8k stars 400 forks source link

Is ```-configuration``` path supposed to be unique per launch of JDTLS? #2596

Closed LakshyAAAgrawal closed 1 year ago

LakshyAAAgrawal commented 1 year ago

As per my understanding, -configuration should be a static location, that contains platform specific information used by JDT.LS, but it should be readonly, and not modified by the process. However, I see that JDT.LS creates many files that get written there.

Could you please clarify the following:

  1. On a given machine, if I am launching several JDT.LS processes, for multiple different java projects, with multiple JDT.LS processes per project, can the directory that is passed as argument to -configuration be the same directory, like $(pwd)/config_linux or does it need to be unique? As suggested in #2482 , I am ensuring that the -data directory is unique per JDT.LS process
  2. Is -Dosgi.sharedConfiguration.area supposed to be used as an alternative to -configuration and the argument $(pwd)/config_linux can be shared by all processes by setting -Dosgi.sharedConfiguration.area instead of -configuration

I have already been using the first configuration, where I had many JDT.LS processes in the same machine, with each JDT.LS process sharing the same -configuration directory. Are the results collected from those processes now invalid?

snjeza commented 1 year ago

On a given machine, if I am launching several JDT.LS processes, for multiple different java projects, with multiple JDT.LS processes per project, can the directory that is passed as argument to -configuration be the same directory

Yes, it can. For instance, VS Code creates <user_home>/.config/Code/User/globalStorage/redhat.java/<java-ls-version>/config_linux for all Java LS processes.

I have already been using the first configuration, where I had many JDT.LS processes in the same machine, with each JDT.LS process sharing the same -configuration directory. Are the results collected from those processes now invalid?

I am ensuring that the -data directory is unique per JDT.LS process

It should work.