-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: CaiJingLong <cjl_spy@163.com>
- Loading branch information
1 parent
943d7c1
commit 736c072
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: "Configuring Java Version in photo_manager" | ||
weight: 1 | ||
--- | ||
|
||
To ensure compatibility with older versions of AGP/flutter SDK, `photo_manager` supports configuring the project's Java version through configuration files, environment variables, and other methods. | ||
|
||
It looks for the Java version in the following order: | ||
|
||
1. Configuration in `gradle.properties` using the `java.version` property. The value should be in the format of a Java version number, such as `1.8`, `11`, `17`, `21`, etc. | ||
2. Using the `JAVA_HOME` environment variable, which should point to the installation path of the JDK. Typically, the Java executable is located at `$JAVA_HOME/bin/java`. | ||
3. Configuration in `gradle.properties` using the `java.home` property. | ||
4. Reading the runtime property `java.home` of the JDK. | ||
5. If none of the above is found, it defaults to using `JavaVersion.current()`. | ||
|
||
Steps 4 and 5 should use the JDK configured in the Gradle settings, which is usually the same. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: "photo_manager 中 java version 的配置方式" | ||
weight: 1 | ||
--- | ||
|
||
photo_manager 为了保证旧版本 AGP/flutter SDK 的兼容性 | ||
所以支持通过配置文件/环境变量等方式来配置项目的 java 版本 | ||
|
||
它们会按照如下的顺序来查找 java 版本: | ||
|
||
1. 通过 `gradle.properties` 中的 `java.version` 配置,它的值应该是一个 java 版本号的字符格式 | ||
例如: `1.8` `11` `17` `21` 等 | ||
2. 通过 `JAVA_HOME` 环境变量,它应该是一个 jdk 的安装路径,java 一般位于 `$JAVA_HOME/bin/java` | ||
3. 通过 `gradle.properties` 中的 `java.home` 来配置 | ||
4. 通过读取 JDK 的运行时属性 `java.home` 来读取 | ||
5. 如果以上都没有找到,那么会使用 JavaVersion.current() | ||
|
||
以上的4、5步骤应该使用的是 Gradle 配置中的 JDK,通常是相同的 |
Submodule flutter_photo_manager
updated
17 files