Skip to content
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

Error setting up native image on Windows #113

Open
rishavs opened this issue Oct 12, 2023 · 0 comments
Open

Error setting up native image on Windows #113

rishavs opened this issue Oct 12, 2023 · 0 comments
Assignees

Comments

@rishavs
Copy link

rishavs commented Oct 12, 2023

Setting up the SL native image on Windows is throwing error.

Here's the steps I followed;
downloaded graalvm for java 21 and added the path to JAVA_HOME
added the bin path to the path variable
downloaded the simple language repo and ran mvn package -Pnative
I received this error
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for simplelanguage-parent 23.1.0:
[INFO]
[INFO] simplelanguage-parent .............................. SUCCESS [ 0.009 s]
[INFO] simplelanguage ..................................... SUCCESS [ 14.600 s]
[INFO] sl-tck ............................................. SUCCESS [ 19.629 s]
[INFO] launcher ........................................... SUCCESS [ 0.220 s]
[INFO] standalone ......................................... FAILURE [ 10.340 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 45.040 s
[INFO] Finished at: 2023-10-12T18:19:27+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.1.0:exec (make_native) on project standalone: Command execution failed.: Cannot run program "C:\sdks\graalvm-jdk-21+35.1\bin\native-image" (in directory "C:\Users\risharan\Documents\Dev\java\simplelanguage-master\standalone"): CreateProcess error=2, The system cannot find the file specified -> [Help 1]

This isfixed if I change the native-image to native-image.cmd in the standalone/pom.xml

                                <configuration>
                                    <executable>
                                        ${env.JAVA_HOME}/bin/native-image.cmd</executable>
                                    <commandlineArgs>
                                        -p %classpath
                                        -H:+ReportExceptionStackTraces
                                        -m ${launcherClass}
                                        -o ${project.build.directory}/slnative
                                    </commandlineArgs>
                                </configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants