我也尝试用 VSC 写 Java , debug 遇到一个问题 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
inza9hi
V2EX    Visual Studio Code

我也尝试用 VSC 写 Java , debug 遇到一个问题

  •  
  •   inza9hi 2024-09-01 00:33:11 +08:00 2421 次点击
    这是一个创建于 454 天前的主题,其中的信息可能已经有所发展或是发生改变。
    运行时成功的:
    命令行:
    cd /data/test ; /usr/bin/env /Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home/bin/java -cp /var/folders/zm/bfm8f7cd687ggw0_wg0xh1mr0000gn/T/cp_4rch529yp8kxh28prgqo1elll.jar com.SimpleCryptoUtil

    Debug 时候:
    命令行:
    /usr/bin/env /Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home/bin/java -agentlib:jdwp=t
    ransport=dt_socketserver=nsuspend=yaddress=localhost:58432 -cp /var/folders/zm/bfm8f7cd687ggw0_wg0xh1mr0000gn/T/cp_4rch529yp8kxh28prgqo1elll.jar com.SimpleCryptoUtil
    ERROR: JDWP Non-server transport dt_socketserver=nsuspend=yaddress=localhost:58432 must have a connection address specified through the 'address=' option
    ERROR: JDWP invalid option: -agentlib:jdwp=transport=dt_socketserver=nsuspend=yaddress=localhost:58432

    明显是逗号没有传入命令行…… 用的 zsh
    自己在 launch.json 里面指定也不行。

    {
    "type": "java",
    "name": "SimpleCryptoUtil",
    "request": "launch",
    "mainClass": "com.SimpleCryptoUtil",
    "projectName": "form",
    "vmArgs": "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
    }
    7 条回复    2024-10-31 00:31:30 +08:00
    coderbean
        1
    coderbean  
       2024-09-01 00:34:32 +08:00 via iPhone
    建议别了,还是用 idea 吧。写 go 之类的还能好点,Java 还是 jetbrains 吧
    inza9hi
        2
    inza9hi  
    OP
       2024-09-01 00:41:36 +08:00
    @coderbean 我和 @leeyuzhe 一样,想尝试一下 cursor ,所以才学习用一下 vscode
    xuanbg
        3
    xuanbg  
       2024-09-01 09:16:35 +08:00
    如果仅从工作角度出发,不建议折腾。如果闲的发慌,折腾折腾挺好的。
    kratosmy
        4
    kratosmy  
       2024-09-01 10:13:11 +08:00
    我也在尝试用 cursor ,话说怎么做到 idea 里 auto import java libs?
    nosilence
        5
    nosilence  
       2024-09-01 13:44:37 +08:00
    同时用 IDEA 和 Cursor 打开相同的项目,Cursor 问答、自动化生成; IDEA 精修、运行。
    leeyuzhe
        6
    leeyuzhe  
       2024-09-01 21:04:41 +08:00
    感觉像是 zsh 的问题,换成 bash 试试,我 mv -P xxx,!zzz 也会报错!zzz 这个命令找不到
    fpure
        7
    fpure  
       2024-10-31 00:31:30 +08:00
    vscode 写 Java 为什么会配置 launch.json ?
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2693 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 27ms UTC 14:19 PVG 22:19 LAX 06:19 JFK 09:19
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86