sinboy1988
V2EX  ›  Emacs

新手向问下,调试程序

  •  
  •   sinboy1988 · Jan 31, 2023 · 2276 views
    This topic created in 1230 days ago, the information mentioned may be changed or developed.

    我用的 doom emacs ,使用 lsp-java 然后在~/.doom.d/config.el 中加入了

    (setq lsp-java-9-args '(
    "-XX:+UseParallelGC"
    "-XX:GCTimeRatio=4"
    "-XX:AdaptiveSizePolicyWeight=90"
    "-Dsun.zip.disableMemoryMapping=true"
    "-Denv=test
    "-Xmx8G"
    "-Xms1G"
    "-javaagent:~/.m2/m2repo/org/projectlombok/lombok/1.18.12/lombok-1.18.12.jar"))
    

    M-x dap-debug-edit-template 添加模板

    (dap-register-debug-template
      "Java Run Configuration"
      (list :name "Debug (Launch) - Current File"
            :type "java"
            :request "launch"
            :args "hello"
            :vmArgs "-Denv=test"
            :jvmArgs "-Denv=test"
            :cwd nil
            :stopOnEntry :json-false
            :host "localhost"
            :request "launch"
            :modulePaths []
            :classPaths nil
            :projectName "MyApp"
            :MainClass Hello))
    

    Hello.java

    
    System.getProperty("env")
    

    M-x dap-debug ,不能获取值到 dev 的值 我想象问问是少了什么步骤吗,还是用的方法有错误?刚接触新手求教

    4 replies    2023-02-02 14:28:18 +08:00
    ThinkCat
        1
    ThinkCat  
       Jan 31, 2023   ❤️ 1
    不建议用 vi 或者 emacs 搞 java ,很麻烦,会有各种坑,严格的说,是在浪费时间。vscode 插件工具链比较齐全,勉强可以用,但是大项目会很卡。还是用 idea 、eclipse 或者 netbeans 最靠谱。
    sinboy1988
        2
    sinboy1988  
    OP
       Jan 31, 2023 via Android
    @ThinkCat 谢谢指点,我想再问问 Emacs 除了 org,从 IDE 考虑可以适合哪些语言的开发?
    ThinkCat
        3
    ThinkCat  
       Feb 1, 2023
    @sinboy1988 个人体验下来,适合非强类型的语言,比如 js ,python ,clojure 这些,当然 lisp 最佳,主要还是看插件的质量。类似 java rust 等,都是走的 vscode 里面 lsp 的模式,很多插件都是开发人员自己做的,能用,但不好用。
    sinboy1988
        4
    sinboy1988  
    OP
       Feb 2, 2023
    @ThinkCat 了解了,几天用下来感觉的确如此,感谢。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   871 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 19:45 · PVG 03:45 · LAX 12:45 · JFK 15:45
    ♥ Do have faith in what you're doing.