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

JDK config in both windows and linux

Open petercao opened this issue 1 year ago • 8 comments

I need to work both in windows and linux(such as archlinux), So when I switch from windows to linux, I need to reconfig JDK path in settings.json config file, but when I reswitch to windows, I need to change JDK config path to windows format again, So do we have some kind of argument that both can config for linux and windows, such as:

/// JDK config for windows "java.jdt.ls.androidSupport.enabled": "on", "java.jdt.ls.java.home.windows": "D:\Program Files\Java\jdk-17", "java.configuration.runtimes": [ { "name": "JavaSE-17", "path": "D:\Program Files\Java\jdk-17", "default": true } ], /// JDK config for linux "java.jdt.ls.java.home.linux": "/jdk-17", "java.configuration.runtimes": [ { "name": "JavaSE-17", "path": "/jdk-17", "default": true } ],

and it will read current system os info and auto switch to corresponding configurations? Can we?

petercao avatar May 28 '24 07:05 petercao

I also need this feature and I agree with your suggestion

zippozeng avatar May 29 '24 09:05 zippozeng

Why don't you configure your user settings on your windows and on your linux machines with the proper paths?

fbricon avatar May 29 '24 09:05 fbricon

As I say, you need to reconfigure jdk path for vscode both in windows and linux, because it can't auto fix the system, and the old local jdk config will be overlay by the synced new config

petercao avatar May 29 '24 10:05 petercao

So the problem is caused by synch'ing the same user config on multiple OS. Do other extensions work around that VS Code synch limitation? Honestly the simplest solution is to disable synch'ing

fbricon avatar May 29 '24 10:05 fbricon

Have you tried https://github.com/microsoft/vscode/issues/5595#issuecomment-1864078397 ? Seems like the best workaround currently

fbricon avatar May 29 '24 10:05 fbricon

Have you tried microsoft/vscode#5595 (comment) ? Seems like the best workaround currently

vscode does not support this configuration, this is what the user came up with

zippozeng avatar May 30 '24 06:05 zippozeng

So the problem is caused by synch'ing the same user config on multiple OS. Do other extensions work around that VS Code synch limitation? Honestly the simplest solution is to disable synch'ing

yeah, it's about the syncing, but you know I will install some plugins or change some config some time, so I need to sync them in different os(linux/windows), some of the config is not platform related, but others like jdk is just platform related. So this is the question.

petercao avatar Jun 01 '24 01:06 petercao

Yes, we need this feature

iwangbowen avatar Jun 22 '24 02:06 iwangbowen