0

I know that this is basicly the same as this but I followed all the advice from the answer and it doesnt work for me... When trying to do anything that isn't - gluonfx:run I get the following error:

"C:\Program Files\Amazon Corretto\jdk11.0.16_8\bin\java.exe" "-Dmaven.multiModuleProjectDirectory=C:\Java Projects\SPO related\Prototypes\SPO Gluon Prototype" "-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2\plugins\maven\lib\maven3\bin\m2.conf" "-Dmaven.ext.class.path=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2\plugins\maven\lib\maven-event-listener.jar" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2\lib\idea_rt.jar=56069:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2\plugins\maven\lib\maven3\boot\plexus-classworlds-2.6.0.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2\plugins\maven\lib\maven3\boot\plexus-classworlds.license" org.codehaus.classworlds.Launcher -Didea.version=2022.2 com.gluonhq:gluonfx-maven-plugin:1.0.16:compile
[INFO] Scanning for projects...
[INFO] 
[INFO] -------< com.spoapplication:spo-gluon-prototype >--------
[INFO] Building SPO Gluon Prototype 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] >>> gluonfx-maven-plugin:1.0.16:compile (default-cli) > process-classes @ spo-gluon-prototype >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ spo-gluon-prototype ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 13 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ spo-gluon-prototype ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] <<< gluonfx-maven-plugin:1.0.16:compile (default-cli) < process-classes @ spo-gluon-prototype <<<
[INFO] 
[INFO] 
[INFO] --- gluonfx-maven-plugin:1.0.16:compile (default-cli) @ spo-gluon-prototype ---
[Thu Jan 12 20:52:44 IST 2023][INFO] ==================== COMPILE TASK ====================
             _______  ___      __   __  _______  __    _
            |       ||   |    |  | |  ||       ||  |  | |
            |    ___||   |    |  | |  ||   _   ||   |_| |
            |   | __ |   |    |  |_|  ||  | |  ||       |
            |   ||  ||   |___ |       ||  |_|  ||  _    |
            |   |_| ||       ||       ||       || | |   |
            |_______||_______||_______||_______||_|  |__|

    Access to the latest docs, tips and tricks and more info on
    how to get support? Register your usage of Gluon Substrate now at

    https://gluonhq.com/activate



[Thu Jan 12 20:52:45 IST 2023][INFO] We will now compile your code for x86_64-microsoft-windows. This may take some time.
java.io.IOException: Cannot run program "cl" (in directory "C:\Java Projects\SPO related\Prototypes\SPO Gluon Prototype\target\gluonfx\x86_64-windows\gvm\SPO Gluon Prototype"): CreateProcess error=2, The system cannot find the file specified
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
    at com.gluonhq.substrate.util.ProcessRunner.setupProcess(ProcessRunner.java:378)
    at com.gluonhq.substrate.util.ProcessRunner.runProcess(ProcessRunner.java:236)
    at com.gluonhq.substrate.target.AbstractTargetConfiguration.compileAdditionalSources(AbstractTargetConfiguration.java:356)
    at com.gluonhq.substrate.target.AbstractTargetConfiguration.compile(AbstractTargetConfiguration.java:134)
    at com.gluonhq.substrate.SubstrateDispatcher.nativeCompile(SubstrateDispatcher.java:425)
    at com.gluonhq.NativeCompileMojo.execute(NativeCompileMojo.java:54)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    at java.base/java.lang.ProcessImpl.create(Native Method)
    at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:492)
    at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:153)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
    ... 30 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.639 s
[INFO] Finished at: 2023-01-12T20:52:45+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.gluonhq:gluonfx-maven-plugin:1.0.16:compile (default-cli) on project spo-gluon-prototype: Error: Cannot run program "cl" (in directory "C:\Java Projects\SPO related\Prototypes\SPO Gluon Prototype\target\gluonfx\x86_64-windows\gvm\SPO Gluon Prototype"): CreateProcess error=2, The system cannot find the file specified -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Process finished with exit code 1

I don't understand why do I get: cannot run program "cl".

I tried reading and re-reading all the gluon documantion and online solutions but it didn't bear any fruit. It could be that I installed VS 2022 or I installed some things incorrectly there.

I need to chat with someone that has experience because I have none, I learned to code the past couple of months for a project in a high school class.

  • [Docs](https://docs.gluonhq.com/#_create_run_a_native_image_of_the_application) do mention that you need Visual Studio, and also that you need to run from an _x64_ terminal. If you use IntelliJ, see the note about customizing the terminal to run `vcvars64.bat`. – José Pereda Jan 12 '23 at 19:18
  • I did try to do use vcvars64.bat as the shell path and it still didn't work... It could be becuase I have VS2022 instead of 19. If that's not the case: Do I need to use the inbuilt terminal? What commands do I need to run to make it work? – MilckShake Beans Jan 13 '23 at 07:48
  • I haven't tried VS2022, but it should work too. As Docs mention, you can simply run from the `x64 Native Tools Command Prompt for VS` outside your IDE, or you can try to modify the `cmd.exe` path in your IDE settings. Just make sure that, before running the project, from any of those terminals if you type `cl` that works (as in the command is found). – José Pereda Jan 13 '23 at 09:18
  • when using the terminal in itellij it closes at a couple of moments after I open the terminal... It closes just before writing : "[vcvarsall.bat] Environment initialized for: 'x64' ". To access the x64 Native Tools Command Prompt for VS I need to open the project in VS? because when I did, it didn't recognize mvn gluonfx:compile as a command... – MilckShake Beans Jan 13 '23 at 09:36
  • The x64 native tools... is a direct access so you can find it for instance typing Win key + `x64` or so. – José Pereda Jan 13 '23 at 10:02
  • thank you but when running cl + it didnt work : " LINK : fatal error LNK1104: cannot open file 'Java.exe' ". What are the commands that I need to run to preform run or build? – MilckShake Beans Jan 13 '23 at 14:12
  • Once you have a terminal that works, cd into your project folder and run `mvn gluonfx:run` your verify it works, and then `mvn gluonfx:build` you build the native image. Just follow the docs… – José Pereda Jan 13 '23 at 14:49
  • I did everything as you said and I get "'mvn' is not recognized as an internal or external command, operable program or batch file." – MilckShake Beans Jan 13 '23 at 20:45
  • Before, you were using Maven preinstalled in IntelliJ from this [path](C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2\plugins\maven\lib\maven3\bin). You can install [Maven](https://maven.apache.org/download.html) as external tool, or use it from that path. – José Pereda Jan 13 '23 at 20:59
  • The commands work when I cd to that directory but mvn gluonfx:run doesnt becuase I dont mention what is my project directory, how do I go about doing that? – MilckShake Beans Jan 13 '23 at 21:16
  • Use the full path? Cd into your project root and then `C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2\plugins\maven\lib\maven3\bin\mvn.exe gluonfx:run`? That is of course not the recommended way to do it, but try it first to see it that works. – José Pereda Jan 13 '23 at 21:33
  • I get "'C:\Program' is not recognized as an internal or external command, operable program or batch file." after cd my project root... Just to be sure the project root is the folder that contains src, target, ect, ect? – MilckShake Beans Jan 13 '23 at 21:41
  • use `"C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2\plugins\maven\lib\maven3\bin\mvn.exe" gluonfx:run` – José Pereda Jan 13 '23 at 21:44
  • I get "'"C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2\plugins\maven\lib\maven3\bin\mvn.exe"' is not recognized as an internal or external command, operable program or batch file." – MilckShake Beans Jan 13 '23 at 21:57
  • You need to solve your issues with paths and terminals to get this working, I can't help you with that. You have all the information available in the docs, and I've mention a few other options (I strongly suggest that you install Maven from the link I've posted earlier). – José Pereda Jan 13 '23 at 22:09

1 Answers1

0

MilckShake Beans and José Pereda. I have seen your dialogues again and again for more than 3 days , for I've met the " Cannot run program 'cl'" error too. After I give up for one day to ease my headache, suddenly I figure out what the Gluon document pre-requisites windows tips. I’m using IntelliJ idea 2022, Java se 17.0.6, and graalvm-svm-java17-windows-gluon-22.1.0.1-Final. Below image is my solution, hope it will help you.

潘亚杰
  • 1
  • 2
  • My [answer](https://drive.google.com/file/d/1JreyT42vCDgvbeihatq2dDBPJLOfh-iR/view?usp=share_link) – 潘亚杰 Apr 16 '23 at 13:41
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 19 '23 at 07:37