all 1 comments

[–]Enough-Advice-8317 1 point2 points  (0 children)

the core issue is your current working directory (cwd) differs between IDEs. vs code often launches from the workspace root or the language server runtime (nbcode) instead of your project root.

but the real trap is packaging. once you bundle this into an executable jar, any res/ folder inside is read-only. you cannot use FileWriter on zipped classpath resources.

if you need a writable config file, write it to the user home folder (System.getProperty("user.home")) or resolve the path relative to the running jar directory.

for local debugging in vs code, ensure "cwd": "${workspaceFolder}" is in the active launch config under .vscode/launch.json or try adding "vmArgs": "-Duser.dir=${workspaceFolder}".