我正在测试一个新项目,并尝试为此使用 Gluon。ATM 我正在使用 AMD Ryzen 7 在 Windows 10 上构建。
按照以下说明操作:https ://docs.gluonhq.com/#platforms_windows
当我尝试构建时:mvn gluonfx:build它失败了:
[INFO] --- gluonfx-maven-plugin:1.0.9:compile (default-cli) @ gluon-singleviewproject-jdk17 ---
[Tue Nov 16 13:14:32 PST 2021][INFO] ==================== COMPILE TASK ====================
_______ ___ __ __ _______ __ _
| || | | | | || || | | |
| ___|| | | | | || _ || |_| |
| | __ | | | |_| || | | || |
| || || |___ | || |_| || _ |
| |_| || || || || | | |
|_______||_______||_______||_______||_| |__|
[Tue Nov 16 13:14:33 PST 2021][INFO] We will now compile your code for x86_64-microsoft-windows. This may take some time.
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
[Tue Nov 16 13:14:34 PST 2021][INFO] [SUB] Warning: Ignoring server-mode native-image argument --no-server.
[Tue Nov 16 13:14:36 PST 2021][INFO] [SUB] [com.gluonapplication.gluonapplication:29680] classlist: 1,238.84 ms, 0.96 GB
[Tue Nov 16 13:14:37 PST 2021][INFO] [SUB] [com.gluonapplication.gluonapplication:29680] setup: 709.11 ms, 0.96 GB
[Tue Nov 16 13:14:37 PST 2021][INFO] [SUB] Error: Native-image building on Windows currently only supports target architecture: AMD64 (x86 unsupported)
[Tue Nov 16 13:14:37 PST 2021][INFO] [SUB] Error: To prevent native-toolchain checking provide command-line option -H:-CheckToolchain
[Tue Nov 16 13:14:37 PST 2021][INFO] [SUB] com.oracle.svm.core.util.UserError$UserException: Native-image building on Windows currently only supports target architecture: AMD64 (x86 unsupported)
[Tue Nov 16 13:14:37 PST 2021][INFO] [SUB] To prevent native-toolchain checking provide command-line option -H:-CheckToolchain
[Tue Nov 16 13:14:37 PST 2021][INFO] [SUB] at com.oracle.svm.core.util.UserError.abort(UserError.java:139)
[Tue Nov 16 13:14:37 PST 2021][INFO] [SUB] at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.addSkipCheckingInfo(CCompilerInvoker.java:103)
[Tue Nov 16 13:14:37 PST 2021][INFO] [SUB] at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.verifyCompiler(CCompilerInvoker.java:94)
[Tue Nov 16 13:14:37 PST 2021][INFO] [SUB] at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:884)
[Tue Nov 16 13:14:37 PST 2021][INFO] [SUB] at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:530)
[Tue Nov 16 13:14:37 PST 2021][INFO] [SUB] at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:491)
[Tue Nov 16 13:14:37 PST 2021][INFO] [SUB] at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:380)
[Tue Nov 16 13:14:37 PST 2021][INFO] [SUB] at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:543)
[Tue Nov 16 13:14:37 PST 2021][INFO] [SUB] at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:119)
[Tue Nov 16 13:14:37 PST 2021][INFO] [SUB] at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:573)
[Tue Nov 16 13:14:37 PST 2021][INFO] [SUB] [com.gluonapplication.gluonapplication:29680] [total]: 1,978.21 ms, 0.96 GB
我的 POM:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.gluonapplication</groupId>
<artifactId>gluon-singleviewproject-jdk17</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Gluon-SingleViewProject-jdk17</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
<javafx.version>17.0.1</javafx.version>
<attach.version>4.0.13</attach.version>
<gluonfx.plugin.version>1.0.9</gluonfx.plugin.version>
<javafx.plugin.version>0.0.8</javafx.plugin.version>
<mainClassName>com.gluonapplication.GluonApplication</mainClassName>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq</groupId>
<artifactId>charm-glisten</artifactId>
<version>6.1.0</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>display</artifactId>
<version>${attach.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>lifecycle</artifactId>
<version>${attach.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>statusbar</artifactId>
<version>${attach.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>storage</artifactId>
<version>${attach.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>util</artifactId>
<version>${attach.version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>Gluon</id>
<url>https://nexus.gluonhq.com/nexus/content/repositories/releases</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>${javafx.plugin.version}</version>
<configuration>
<mainClass>${mainClassName}</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>com.gluonhq</groupId>
<artifactId>gluonfx-maven-plugin</artifactId>
<version>${gluonfx.plugin.version}</version>
<configuration>
<target>host</target>
<attachList>
<list>display</list>
<list>lifecycle</list>
<list>statusbar</list>
<list>storage</list>
</attachList>
<mainClass>${mainClassName}</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>ios</id>
<properties>
<gluonfx.target>ios</gluonfx.target>
</properties>
</profile>
<profile>
<id>android</id>
<properties>
<gluonfx.target>android</gluonfx.target>
</properties>
</profile>
</profiles>
</project>
这基本上是 hellofxml,非常感谢任何关于调试的想法或指针。