坑:
1. JDK17 windows native编译只支持到3.20.0,这是我自己测试的版本,不一定真是
JDK17支持 我当前的quarkus最新版为3.25.3,去官网下载JDK17支持的版本发现和JDK21是一致的,但是坑来了,JDK17编译怎么都不通过,后来直接换JDK版本了
2. caffeine native 缓存支持一部分功能,不支持统计等,或报错找不到class SSSMS
3. 编译Linux 编译只能用docker运行时,windows自带的只能执行成exe可执行文件
但是我查看日志发现本地docker 运行了如下操作
4. 发现运行DockerFile.native-micro 构建成功后docker运行发现镜像不支持
The current machine does not support all of the following CPU features that are required by the image: [CX8, CMOV, FXSR, MMX, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, POPCNT, LZCNT, AVX, AVX2, BMI1, BMI2, FMA]. 2025-08-21T03:22:36.613702858Z Please rebuild the executable with an appropriate setting of the -march option
更换为graalvm 最好是环境变量也改了
Pulling builder image 'quay.io/quarkus/ubi9-quarkus-mandrel-builder-image:jdk-21'
docker run --env LANG=C --rm -v /d/project/java/tesla-bot/tesla-starter/target/tesla-starter-1.0-SNAPSHOT-native-image-source-jar:/project:z --name b
uild-native-nuNMr quay.io/quarkus/ubi9-quarkus-mandrel-builder-image:jdk-21 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dcom.mysql.cj.disableAbandonedConn
ectionCleanup=true -J-DCoordinatorEnvironmentBean.transactionStatusManagerEnable=false -J-Duser.language=zh -J-Duser.country=CN -J-Dlogging.initial-configurator.min-level=500 -J-Dvertx.logger-delegate-factory-clas
s-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -H:+UnlockExperimentalVMOptions -H:Include
Locales=zh-CN -H:-UnlockExperimentalVMOptions -J-Dfile.encoding=UTF-8 -J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED --features=io.quarkus.hibernate.validator.runtime.DisableLo
ggingFeature,io.quarkus.caffeine.runtime.graal.CacheConstructorsFeature,io.quarkus.runner.Feature,io.quarkus.runtime.graal.DisableLoggingFeature,io.quarkus.runtime.graal.SkipConsoleServiceProvidersFeature -J--add-
exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-exports=java.security.jgss/sun.security.jgss=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED -J--add-opens=java.base/java.io=ALL-UNNAMED -
J--add-opens=java.base/java.lang.invoke=ALL-UNNAMED -J--add-opens=java.base/java.util=ALL-UNNAMED -H:+UnlockExperimentalVMOptions -H:BuildOutputJSONFile=tesla-starter-1.0-SNAPSHOT-runner-build-output-stats.json -H
:-UnlockExperimentalVMOptions -H:+UnlockExperimentalVMOptions -H:+GenerateBuildArtifactsFile -H:-UnlockExperimentalVMOptions --strict-image-heap --install-exit-handlers -H:+UnlockExperimentalVMOptions -H:+AllowFol
dMethods -H:-UnlockExperimentalVMOptions -J-Djava.awt.headless=true --no-fallback --link-at-build-time -H:+UnlockExperimentalVMOptions -H:+ReportExceptionStackTraces -H:-UnlockExperimentalVMOptions -H:+AddAllChars
ets --enable-url-protocols=http,https --enable-monitoring=heapdump -H:+UnlockExperimentalVMOptions -H:-UseServiceLoaderFeature -H:-UnlockExperimentalVMOptions -J--add-exports=org.graalvm.nativeimage/org.graalvm.na
tiveimage.impl=ALL-UNNAMED --exclude-config io\.netty\.netty-codec /META-INF/native-image/io\.netty/netty-codec/generated/handlers/reflect-config\.json --exclude-config io\.netty\.netty-handler /META-INF/native-image/io\.netty/netty-handler/generated/handlers/reflect-config\.json tesla-starter-1.0-SNAPSHOT-runner -jar tesla-starter-1.0-SNAPSHOT-runner.jar
感觉还是可以远程到docker 操作的