请点击以下链接
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 功能(如本机映像)?
正如@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