-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lsp-java-configuration-runtimes And dap-java-java-command not warking #443
Comments
That way of starting the application is performed by the jdtls, thus the server thinks that this project is 17. Check the .classpath in the root of the project. Alternativelly you may do M-x dap-debug and pick |
I tried using Java Run Configuration (compile/attach) |
You can register template with your settings. M-x dap-debug-edit-template (check which version you would want to use the one with C-u or not) |
(dap-register-debug-template "xxx-template" This is my template when I start with this template :env and :vmArgs have no effect Is my template configuration wrong? |
can you check if these are vectors? |
|
thanks thanks 🙏 How to set :env or :environment-variables when request is compile_attach? i set It takes effect when the request is launch, but it will not take effect when the request is changed to compile_attach. |
Sounds like a bug. As a workaround you may set them in emacs like: |
thaks it work! |
I opened a PR to allow configure the vmArgs to be used by the dap-java-debug function. Link: #450 |
(use-package lsp-java
:ensure t
:init
(setq lsp-java-java-path "/usr/local/Cellar/openjdk@17/17.0.7/libexec/openjdk.jdk/Contents/Home/bin/java")
:config
(setq lsp-java-configuration-runtimes '[(:name "JavaSE-1.8"
:path "/usr/local/Cellar/openjdk@8/1.8.0+372/libexec/openjdk.jdk/Contents/Home/"
:default t
)
(:name "JavaSE-17"
:path "/usr/local/Cellar/openjdk@17/17.0.7/libexec/openjdk.jdk/Contents/Home/"
)])
(add-hook 'java-mode-hook 'lsp))
(require 'lsp-java-boot)
;; to enable the lenses
(add-hook 'lsp-mode-hook #'lsp-lens-mode)
(add-hook 'java-mode-hook #'lsp-java-boot-lens-mode)
(setq lsp-inhibit-message t)
(setq lsp-ui-sideline-update-mode 'point)
(setq dap-java-java-command "/usr/local/Cellar/openjdk@8/1.8.0+372/libexec/openjdk.jdk/Contents/Home/bin/java")
;;(setq dap-java-java-command "/usr/local/Cellar/openjdk@17/17.0.7/libexec/openjdk.jdk/Contents/Home/bin/java")
(setq lsp-java-import-maven-enabled 1)
(setq lsp-java-configuration-maven-user-settings "/Users/zhou/Documents/DevelopTool/maven/settings.xml")
(setq lsp-java-vmargs '(
"-XX:+UseParallelGC"
"-XX:GCTimeRatio=4"
"-XX:AdaptiveSizePolicyWeight=90"
"-Dsun.zip.disableMemoryMapping=true"
"-Xmx6G"
"-Xms2G"
"-javaagent:/Users/zhou/Documents/DevelopTool/maven/repository/org/projectlombok/lombok/1.18.26/lombok-1.18.26.jar"
))
this is my setting
I set dap-java-java-command to use 1.8 version of java but when I use dap-debug to debug the program it still uses 17 version of java
How to specify the java version when I debug the program with dap-debug
The text was updated successfully, but these errors were encountered: