You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`java21` Package a `modular` JavaFX project using `Maven`, `Gradle`, and `GraalVM`.
7
+
-`java21-non-modular`[Link](https://github.com/JavaFX-Starter/JavaFX-Package-Sample/tree/java21-non-modular) Package a `non-modular` JavaFX project using `Maven`.
8
+
-`java22-win32`[Link](https://github.com/JavaFX-Starter/JavaFX-Package-Sample/tree/java22-win32) A JavaFX project that implements Windows global keyboard event listening by utilizing the `Foreign Function and Memory (FFM) API`.
- 由于本项目中gradle配置使用的插件功能更完整,所以推荐使用gradle来构建本项目,如果只能选择maven的话,由于`Maven plugin for JavaFX`已经许久没有更新,`JDK21`中`jlink`的参数`--compress`新的值也不支持,建议去寻找第三方维护的插件来使用,当然你的项目足够简单的话,`pom.xml`自定义的构建命令也许能够完全支持你的项目
- 请运行在由`Visual Studio`提供的命令行环境中,`Windows 终端`可以直接在标签页中打开`Developer PowerShell for VS 2022`,其他用户可以在开始菜单的`Visual Studio 2022`文件夹中找到
90
+
- 请运行在由`Visual Studio`提供的命令行环境中,`Windows 终端`可以直接在标签页中打开`Developer PowerShell for VS 2022`
91
+
,其他用户可以在开始菜单的`Visual Studio 2022`文件夹中找到
82
92
- 不关注 `module-info.java` 文件的存在与否
83
93
84
94
#### JAVA_HOME和GRAALVM_HOME可以设置为相同值
95
+
85
96
```shell
86
97
>$env:JAVA_HOME
87
98
C:\CommandLineTools\Java\graalvm-jdk-21.0.2+13.1\
88
99
>$env:GRAALVM_HOME
89
100
C:\CommandLineTools\Java\graalvm-jdk-21.0.2+13.1\
90
101
```
102
+
91
103
#### 此项目使用的 Oracle GraalVM 版本
104
+
92
105
```shell
93
106
java 21.0.2 2024-01-16 LTS
94
107
Java(TM) SE Runtime Environment Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-LTS-jvmci-23.1-b30)
95
108
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-LTS-jvmci-23.1-b30, mixed mode, sharing)
96
109
```
110
+
97
111
##### gradle
112
+
98
113
###### 构建与运行
114
+
99
115
```shell
100
116
.\gradlew.bat nativeBuild
101
117
.\gradlew.bat nativeRun
102
118
```
119
+
103
120
###### `Downloading JavaFX static libs...`网络问题
104
-
Gluon下载`JavaFX static libs`涉及到的相关源码[FileOps.java](https://github.com/gluonhq/substrate/blob/master/src/main/java/com/gluonhq/substrate/util/FileOps.java),因此可以通过配置`java`的一些系统属性(需要梯子)来加速,在项目根目录下新建文件`gradle.properties`内容如下,配置项的有关文档[Java Networking and Proxies](https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html),gradle相关文档[Accessing the web through a proxy](https://docs.gradle.org/current/userguide/build_environment.html#ex-configuring-an-http-proxy-using-gradle-properties)
内容如下,配置项的有关文档[Java Networking and Proxies](https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html)
126
+
,gradle相关文档[Accessing the web through a proxy](https://docs.gradle.org/current/userguide/build_environment.html#ex-configuring-an-http-proxy-using-gradle-properties)
0 commit comments