-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[native-image] [windows] 19.3.0 - trivial .jar can't be made into an exe #1850
Comments
This looks like a Visual Studio tools version mismatch. I'm not sure which version of Visual Studio was used to build GraalVM but it looks like you may be using an old version of Visual Studio to link your JavaHelloWorld.exe file. The interface to the Visual Studio C Runtime library changed in VS2015. What version of Visual Studio do you have? |
I'm using the one that was recommended for GraalVM 19.0.0, and building .exe files in 19.0.0, 19.1.0, and 19.2.0 (if I recall correctly, but definitely 19.0.0 and 19.1.0) worked. It's Windows SDK 7.1. I think it came with the 2010 Visual C++ Compilers. Does it say anywhere what specific version of the Windows SDK we now have to use? |
You are build with the JDK 11 version of GraalVM which is most likely built with a newer Visual Studio. Earlier GraalVM versions, were JDK 8 based. The JDK 8 versions used Visual Studio 10. The Java team builds JDK 11 with Visual Studio 2017. There is a Windows implementation of GraalVM 19.3 that uses JDK 8. You can try this as a work-around until you get a newer VS version. |
Would newer versions work, or does it specifically have to be 2017? |
I'd recommend using 2017 since that's the version that will be used for the Java binaries included for the Java 11 version of GraalVM but I don't know for sure which version the current 19.3 is using. Aleksandar Pejovik who is assigned to this issue will know for sure. |
That fixed it, thanks @bobvandette |
@pejovica it would be good if we could have Native Image check for compatibility with known Visual Studio versions and at least issue a warning when an untested version is present. |
I added #1852 to improve the docs for the Windows native image prerequisites. |
I have exactly the same issue . |
Install VS2017 community edition from https://my.visualstudio.com/Downloads?q=visual%20studio%202017&wt.mc_id=o~msft~vscom~older-downloads |
Done. |
That completely fixed the issue for me - you have to use the |
YES. |
OK. |
To activate the VS 2017 environment from the cmd prompt on a CI server:
|
@remkop, that will set up a x86 toolchain, which we don't support. You need to set up a x64 toolchain, e.g., using |
I use this command to prepare to use Visual Studio 2017 for building GraalVM. cd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build" |
@pejovica @bobvandette The full command to activate the VS 2017 environment was exactly what I was looking for. This is very helpful, thank you! I will try this and add a note to #1852 |
Code is literally just a class with
System.out.println("hello world");
and it runs correctly as a .jar with the system's JDK.I'm running from the Windows 7 x64 Debug Build Environment console as with previous versions of GraalVM for Windows.
The text was updated successfully, but these errors were encountered: