Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to set Java 21 as minimal version #6867

Open
JohnNiang opened this issue Oct 14, 2024 · 0 comments
Open

Request to set Java 21 as minimal version #6867

JohnNiang opened this issue Oct 14, 2024 · 0 comments
Labels
area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature.

Comments

@JohnNiang
Copy link
Member

Your current Halo version

2.20.2

Describe this feature

Although we supports Halo to run in JRE 21, we also compile Halo with JDK 17 instead of JDK 21. If we introduce dependencies which require minimal Java version of 21, Halo cannot be compiled in JDK 17. You can see the errors below when I upgrade to Lucene 10.0.0(Java 21 required):

❯ java -version
openjdk version "17.0.11" 2024-04-16 LTS
OpenJDK Runtime Environment Zulu17.50+19-CA (build 17.0.11+9-LTS)
OpenJDK 64-Bit Server VM Zulu17.50+19-CA (build 17.0.11+9-LTS, mixed mode, sharing)
❯ ./gradlew :application:compileJava

> Task :application:compileJava FAILED
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/search/lucene/LuceneSearchEngine.java:3: error: cannot access Field
import static org.apache.lucene.document.Field.Store.YES;
                                        ^
  bad class file: /Users/johnniang/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-core/10.0.0/5a9b3f728041df5b054aaaed3c3fd7ff0fed8ee7/lucene-core-10.0.0.jar(/org/apache/lucene/document/Field.class)
    class file has wrong version 65.0, should be 61.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

But I'm not sure what will happen after we set minimal Java version to 21, such as whether plugins will work properly.

Additional information

/kind feature
/area core

@f2c-ci-robot f2c-ci-robot bot added kind/feature Categorizes issue or PR as related to a new feature. area/core Issues or PRs related to the Halo Core labels Oct 14, 2024
@JohnNiang JohnNiang changed the title Request to set minimal Java version to 21 Request to set Java 21 as minimal version Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant