Gluon Mobile (JavaFX):无法执行目标 com.gluonhq:client-maven-plugin:0.1.38
Gluon Mobile (JavaFX): Failed to execute goal com.gluonhq:client-maven-plugin:0.1.38
当我尝试在 Linux 上创建基于 Gluon Mobile 的应用程序的本机图像时遇到错误。
我克隆了 HelloGluon 示例,通过从 Maven 工具中选择 Plugins → javafx → javafx:run
[=43],我可以成功地 运行 它作为 Java 应用程序而没有任何错误=] 在 IntelliJ IDEA 中。
当我想在 Fedora Linux 上将其构建为本机映像时,一切都出错了。当我从 Maven 工具 window 选择 Plugins → client → client:build
目标来制作原生图像时,它显示了以下错误。
Failed to execute goal com.gluonhq:client-maven-plugin:0.1.38:build (default-cli) on project hellogluon: Error, client:build failed
我再次尝试使用 -X(生成执行调试输出)构建应用程序,但遇到以下情况:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.648 s
[INFO] Finished at: 2021-03-13T11:20:34+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.gluonhq:client-maven-plugin:0.1.38:build (default-cli) on project hellogluon: Error, client:build failed: Error while executing process. Cannot run program "/home/eloy/dev/idea-IU-203.7148.57/plugins/maven/lib/maven3/bin/mvn" (in directory "/home/eloy/projects/gluon-samples/HelloGluon"): error=13, Permission denied -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.gluonhq:client-maven-plugin:0.1.38:build (default-cli) on project hellogluon: Error, client:build failed
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
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 jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at 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: org.apache.maven.plugin.MojoExecutionException: Error, client:build failed
at com.gluonhq.NativeBuildMojo.execute (NativeBuildMojo.java:82)
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 jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at 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: org.codehaus.plexus.util.cli.CommandLineException: Error while executing process.
at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:680)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLineAsCallable (CommandLineUtils.java:136)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine (CommandLineUtils.java:106)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine (CommandLineUtils.java:75)
at org.apache.maven.shared.invoker.DefaultInvoker.executeCommandLine (DefaultInvoker.java:159)
at org.apache.maven.shared.invoker.DefaultInvoker.execute (DefaultInvoker.java:112)
at com.gluonhq.NativeBuildMojo.execute (NativeBuildMojo.java:80)
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 jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at 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: Cannot run program "/home/eloy/dev/idea-IU-203.7148.57/plugins/maven/lib/maven3/bin/mvn" (in directory "/home/eloy/projects/gluon-samples/HelloGluon"): error=13, Permission denied
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1128)
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1071)
at java.lang.Runtime.exec (Runtime.java:589)
at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:675)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLineAsCallable (CommandLineUtils.java:136)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine (CommandLineUtils.java:106)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine (CommandLineUtils.java:75)
at org.apache.maven.shared.invoker.DefaultInvoker.executeCommandLine (DefaultInvoker.java:159)
at org.apache.maven.shared.invoker.DefaultInvoker.execute (DefaultInvoker.java:112)
at com.gluonhq.NativeBuildMojo.execute (NativeBuildMojo.java:80)
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 jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at 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: error=13, Permission denied
at java.lang.ProcessImpl.forkAndExec (Native Method)
at java.lang.ProcessImpl.<init> (ProcessImpl.java:340)
at java.lang.ProcessImpl.start (ProcessImpl.java:271)
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1107)
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1071)
at java.lang.Runtime.exec (Runtime.java:589)
at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:675)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLineAsCallable (CommandLineUtils.java:136)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine (CommandLineUtils.java:106)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine (CommandLineUtils.java:75)
at org.apache.maven.shared.invoker.DefaultInvoker.executeCommandLine (DefaultInvoker.java:159)
at org.apache.maven.shared.invoker.DefaultInvoker.execute (DefaultInvoker.java:112)
at com.gluonhq.NativeBuildMojo.execute (NativeBuildMojo.java:80)
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 jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at 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)
[ERROR]
[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
环境规范:
- 软呢帽 30 XFCE
- 甲骨文jdk-11.0.10
- 行家 3.6.3
- graalvm-ce-java11-21.0.0
- Gluon 插件 2.8.5 (IntelliJ IDEA)
我可以解决上述问题。看来我没有正确设置环境变量,还缺少一些 OS 库。虽然可以使用 IDE 的 Maven window,但最好通过终端 运行 你的 maven 目标。以下所有命令都在终端内执行。
为了将此应用程序构建为本机映像,您需要 Maven、Java 11+、JavaFX 15+、Gluon Mobile 和 GraalVM。您可以使用安装 OpenJDK 或下载 OracleJDK from Oracle. Download the latest version of GraalVM. And do not worry about JavaFX 15 and Gluon Mobile because these dependencies will be resolved by maven.
通过编辑 .bashrc
设置环境变量并添加以下路径(应用更改不要忘记注销然后登录,或 source .bashrc
)
export JAVA_HOME="/home/eloy/dev/jdk-11.0.10"
export PATH=$JAVA_HOME/bin:$PATH
export M2_HOME="/home/eloy/dev/apache-maven-3.6.3"
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
export GRAALVM_HOME="/home/eloy/dev/graalvm-ce-java11-21.0.0.2"
确保你有
gcc
版本6或更高版本
ld
版本2.26或更高版本
到目前为止,您可以通过 mvn client:compile
编译您的应用程序,但要完成 link 阶段,您需要以下库和依赖项:
配置 Yum 存储库:在您的 Fedora 上安装并启用 RPMfusion 存储库
dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
然后安装所需的库:
dnf install freetype-devel glib2-devel gtk3-devel libX11-devel
dnf install libXtst-devel mesa-libGL-devel pango-devel zlib-devel
dnf install alsa-lib-devel ffmpeg-devel
dnf install libstdc++-static
现在您可以 运行 mvn client:link
并且您将在 ../HelloGluon/target/client/x86_64-linux/
目录中有一个 .sh
文件。
注意:client:build
只是自动组合了 client:compile
和 client:link
两个目标和 运行 中的每一个。
PS 这些步骤已在 Fedora 30、31 和 32 上测试。
当我尝试在 Linux 上创建基于 Gluon Mobile 的应用程序的本机图像时遇到错误。
我克隆了 HelloGluon 示例,通过从 Maven 工具中选择 Plugins → javafx → javafx:run
[=43],我可以成功地 运行 它作为 Java 应用程序而没有任何错误=] 在 IntelliJ IDEA 中。
当我想在 Fedora Linux 上将其构建为本机映像时,一切都出错了。当我从 Maven 工具 window 选择 Plugins → client → client:build
目标来制作原生图像时,它显示了以下错误。
Failed to execute goal com.gluonhq:client-maven-plugin:0.1.38:build (default-cli) on project hellogluon: Error, client:build failed
我再次尝试使用 -X(生成执行调试输出)构建应用程序,但遇到以下情况:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.648 s
[INFO] Finished at: 2021-03-13T11:20:34+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.gluonhq:client-maven-plugin:0.1.38:build (default-cli) on project hellogluon: Error, client:build failed: Error while executing process. Cannot run program "/home/eloy/dev/idea-IU-203.7148.57/plugins/maven/lib/maven3/bin/mvn" (in directory "/home/eloy/projects/gluon-samples/HelloGluon"): error=13, Permission denied -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.gluonhq:client-maven-plugin:0.1.38:build (default-cli) on project hellogluon: Error, client:build failed
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
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 jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at 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: org.apache.maven.plugin.MojoExecutionException: Error, client:build failed
at com.gluonhq.NativeBuildMojo.execute (NativeBuildMojo.java:82)
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 jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at 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: org.codehaus.plexus.util.cli.CommandLineException: Error while executing process.
at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:680)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLineAsCallable (CommandLineUtils.java:136)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine (CommandLineUtils.java:106)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine (CommandLineUtils.java:75)
at org.apache.maven.shared.invoker.DefaultInvoker.executeCommandLine (DefaultInvoker.java:159)
at org.apache.maven.shared.invoker.DefaultInvoker.execute (DefaultInvoker.java:112)
at com.gluonhq.NativeBuildMojo.execute (NativeBuildMojo.java:80)
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 jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at 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: Cannot run program "/home/eloy/dev/idea-IU-203.7148.57/plugins/maven/lib/maven3/bin/mvn" (in directory "/home/eloy/projects/gluon-samples/HelloGluon"): error=13, Permission denied
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1128)
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1071)
at java.lang.Runtime.exec (Runtime.java:589)
at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:675)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLineAsCallable (CommandLineUtils.java:136)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine (CommandLineUtils.java:106)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine (CommandLineUtils.java:75)
at org.apache.maven.shared.invoker.DefaultInvoker.executeCommandLine (DefaultInvoker.java:159)
at org.apache.maven.shared.invoker.DefaultInvoker.execute (DefaultInvoker.java:112)
at com.gluonhq.NativeBuildMojo.execute (NativeBuildMojo.java:80)
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 jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at 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: error=13, Permission denied
at java.lang.ProcessImpl.forkAndExec (Native Method)
at java.lang.ProcessImpl.<init> (ProcessImpl.java:340)
at java.lang.ProcessImpl.start (ProcessImpl.java:271)
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1107)
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1071)
at java.lang.Runtime.exec (Runtime.java:589)
at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:675)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLineAsCallable (CommandLineUtils.java:136)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine (CommandLineUtils.java:106)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine (CommandLineUtils.java:75)
at org.apache.maven.shared.invoker.DefaultInvoker.executeCommandLine (DefaultInvoker.java:159)
at org.apache.maven.shared.invoker.DefaultInvoker.execute (DefaultInvoker.java:112)
at com.gluonhq.NativeBuildMojo.execute (NativeBuildMojo.java:80)
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 jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at 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)
[ERROR]
[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
环境规范:
- 软呢帽 30 XFCE
- 甲骨文jdk-11.0.10
- 行家 3.6.3
- graalvm-ce-java11-21.0.0
- Gluon 插件 2.8.5 (IntelliJ IDEA)
我可以解决上述问题。看来我没有正确设置环境变量,还缺少一些 OS 库。虽然可以使用 IDE 的 Maven window,但最好通过终端 运行 你的 maven 目标。以下所有命令都在终端内执行。
为了将此应用程序构建为本机映像,您需要 Maven、Java 11+、JavaFX 15+、Gluon Mobile 和 GraalVM。您可以使用安装 OpenJDK 或下载 OracleJDK from Oracle. Download the latest version of GraalVM. And do not worry about JavaFX 15 and Gluon Mobile because these dependencies will be resolved by maven.
通过编辑 .bashrc
设置环境变量并添加以下路径(应用更改不要忘记注销然后登录,或 source .bashrc
)
export JAVA_HOME="/home/eloy/dev/jdk-11.0.10"
export PATH=$JAVA_HOME/bin:$PATH
export M2_HOME="/home/eloy/dev/apache-maven-3.6.3"
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
export GRAALVM_HOME="/home/eloy/dev/graalvm-ce-java11-21.0.0.2"
确保你有
gcc
版本6或更高版本ld
版本2.26或更高版本
到目前为止,您可以通过 mvn client:compile
编译您的应用程序,但要完成 link 阶段,您需要以下库和依赖项:
配置 Yum 存储库:在您的 Fedora 上安装并启用 RPMfusion 存储库
dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
然后安装所需的库:
dnf install freetype-devel glib2-devel gtk3-devel libX11-devel
dnf install libXtst-devel mesa-libGL-devel pango-devel zlib-devel
dnf install alsa-lib-devel ffmpeg-devel
dnf install libstdc++-static
现在您可以 运行 mvn client:link
并且您将在 ../HelloGluon/target/client/x86_64-linux/
目录中有一个 .sh
文件。
注意:client:build
只是自动组合了 client:compile
和 client:link
两个目标和 运行 中的每一个。
PS 这些步骤已在 Fedora 30、31 和 32 上测试。