apache / apache/netbeans

New VSCode command JDK Configuration clashes with jdkhome 'machine' scope

Open
#7,424 1 comment 0 reactions 3 assignees Claimed by @sdedic View on GitHub
kind:bug VSCode Extension
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 22 release candidate

### What happened

Using new JDK Configuration command to set all Java environments and extensions to same JDK.
In the step 3/3 select Workspace
![Step3](https://github.com/apache/netbeans/assets/26064232/020f353d-3637-4760-8757-a9d597e4aa1c)
Click OK and following warning is shown by VSCode for VSNetBeans:
![Warning](https://github.com/apache/netbeans/assets/26064232/4e0dcc98-3c5c-4a05-aabb-47a9163d92ee)
It is caused by fact that in [package.json](https://github.com/apache/netbeans/blob/f328c4be53dc1d1210eeff62c098360e5574bf61/java/java.lsp.server/vscode/package.json#L114) `netbeans.jdkhome` has `scope=machine`
This kind of break the purpose of JDK Configuration command for VSNetBeans if user wants to set that to Workspace level but VSNetBeans JDK runtime can be set only at machine/user level.
This needs to be discussed how to change that.
Allow to set JDK per workspace can allow to run each instance of VSNetBeans on own JDK version? Can help projects using various JDKs open in VSNetBeans. Implications:

1. Does it affect setting `Netbeans: Userdir: Local | global`?
2. How it affects VSNetBeans when running using Remote SSH on different host with different JDK?
3. Probably more to consider...

### Language / Project Type / NetBeans Component

_No response_

### How to reproduce

Steps above

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

macOS and others

### JDK

JDK indepdendent

### Apache NetBeans packaging

Apache VSNetBeans for VSCode

### Anything else

_No response_

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.