如何将bat文件关联到Windows 11中VS 2022的x64 Native Tools命令提示符?

问题描述 投票:0回答:1

请点击以下链接

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2022\Visual Studio Tools\VC\x64 Native Tools Command Prompt for VS 2022.lnk

属性如下:

Target: %comspec% /k "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
Open File Localtion: C:\Windows\System32\cmd.exe

如何将 bat 文件的双击行为从“cmd”更改为“x64 Native Tools Command Prompt for VS 2022”以使用 graalvm 功能(如本机映像)?

windows batch-file cmd native graalvm-native-image
1个回答
0
投票

正如@GregHNZ回答的那样,下面是一个用于编译本机的示例bat文件内容,可以通过双击来调用

call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
native-image -H:ConfigurationFileDirectories=config -march=compatibility --enable-url-protocols=http,https --enable-preview --add-modules jdk.incubator.vector -jar target\com.tugalsan.gvm.vnc.web-1.0-SNAPSHOT-jar-with-dependencies.jar com.tugalsan.gvm.vnc.web
© www.soinside.com 2019 - 2024. All rights reserved.