Can i forbid loading gradle version?
If i start debugger with command line, can i forbid loading gradle version?
What do you mean by "loading gradle version" ? I think we need more details on exactly what you're trying to do. If your project has a gradle wrapper, that will be respected and it should be configured appropriately. If not, then you can use "java": { "import": { "gradle": { "version": "8.0.0" } } } to force a specific version.
See https://github.com/eclipse-jdtls/eclipse.jdt.ls/blob/c2cd62753e7ef49ad866e74b0f52aee418d6e499/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java#L161-L200 .
I am trying to using jdt as a debuger server, since i do not need to build a project, is it necessary to have a gradle wrapper? it seems that jdt will try to download published gradle versions if my enviroment does not have one, if it is not necessary, i am wondering if i can forbid this downloading behavior? thanks
You could set "java": { "import": { "gradle": { "enabled": false } } } to disable Gradle project importing. I think that should disable any downloading of Gradle wrappers.
i am launching jdt with cmd so i do not have a vscode settings.json to set "java": { "import": { "gradle": { "enabled": false } } }, i try to create a settings.json in workspace but it doesn't help. I found this issue https://github.com/eclipse-jdtls/eclipse.jdt.ls/issues/1380, the error he meet is exactly what i say, but in this issue i only find a wiki about how to using a proxy. Since i do not need to download build runtimes, java dependencies or their sources, can i just fobid this downloading? Or maybe "java": { "import": { "gradle": { "enabled": false } } } can help, but i didn't use it in a right way?
Do you actually see the error Caused by: java.net.UnknownHostException: services.gradle.org ?
You don't need a .vscode/settings.json to set. In fact, the setting for VS Code would be "java.import.gradle.enabled": false which gets converted to "java": { "import": { "gradle": { "enabled": false } } }. Your client should have a way to set settings passed to the language server. If you look at https://github.com/mfussenegger/nvim-jdtls?tab=readme-ov-file#configuration-verbose , you'll see they have
settings = {
java = {
}
},