Building vtk 9.4.0 on windows Java

Also, please, check whether this is your case:

It seems there is a kind of “AnyCPU” “Any CPU” (notice the space) configuration bug that started way back in VS2003 and was still observerd in VS2019. The other more recent answers there may also cast light on what may be wrong in the configuration of your VS installation.