I followed as per the doc of graalvm https://www.graalvm.org/latest/getting-started/windows/
Followed this step and it fixed:
Select the Desktop development with C++ checkbox in the main window. On the right side under Installation Details, make sure that the two requirements, Windows 11 SDK and MSVC (…) C++ x64/x86 build tools, are selected. Continue by clicking Install.