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

Java 22 support #19

Open
adityasamant25 opened this issue May 3, 2024 · 5 comments
Open

Java 22 support #19

adityasamant25 opened this issue May 3, 2024 · 5 comments

Comments

@adityasamant25
Copy link

Firstly a big thanks for this project. It is a life-saver for Macs on the silicon chip.

Just a quick question, will there be support for Java 22 or does the project support LTS releases only?

@NotBjoggisAtAll
Copy link

Bump! I also want Java 22!

@dashaun
Copy link
Owner

dashaun commented Jun 8, 2024

I didn't plan to push any more releases, because the upstream https://github.com/paketo-buildpacks now have multi-arch support for https://github.com/paketo-buildpacks/java and https://github.com/paketo-buildpacks/java-native-image AND they already have Java 22 support!

This is my new maven config:

    <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>build-info</id>
            <goals>
              <goal>build-info</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <image>
            <builder>paketobuildpacks/builder-jammy-buildpackless-tiny</builder>
            <buildpacks>
              <buildpack>paketobuildpacks/java</buildpack>
            </buildpacks>
            <env>
              <BPL_SPRING_AOT_ENABLED>true</BPL_SPRING_AOT_ENABLED>
              <BP_JVM_CDS_ENABLED>true</BP_JVM_CDS_ENABLED>
              <BP_JVM_VERSION>22</BP_JVM_VERSION>
            </env>
          </image>
        </configuration>
      </plugin>

or

<build>
    <plugins>
      <plugin>
        <groupId>org.graalvm.buildtools</groupId>
        <artifactId>native-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>build-info</id>
            <goals>
              <goal>build-info</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <image>
            <builder>paketobuildpacks/builder-jammy-buildpackless-tiny</builder>
            <buildpacks>
              <buildpack>paketobuildpacks/java-native-image</buildpack>
            </buildpacks>
          </image>
        </configuration>
      </plugin>
    </plugins>
  </build>

Spring Boot 3.3 now has CDS support, so the JVM images startup even faster!

Take the upstream multi-arch-buildpacks for a spin. If they don't work out for you, I'll deploy a new release!

@dashaun
Copy link
Owner

dashaun commented Jun 8, 2024

@adityasamant25 @NotBjoggisAtAll I'll leave this open, but I really want you to try the upstream buildpacks, because they work! Let me know how it goes!

@lpellegr
Copy link

lpellegr commented Aug 22, 2024

@dashaun Thanks a lot for the information and Maven example.

Here is the configuration for use with Gradle:

bootBuildImage {
    builder = 'paketobuildpacks/builder-jammy-buildpackless-tiny'
    buildpacks = ['paketobuildpacks/java-native-image']
}

@edudar-chwy
Copy link

edudar-chwy commented Sep 23, 2024

The buildpack have multi-arch support but images they publish, like builder-jammy-tiny, are not multi-arch so builds runs via rosetta on MacOS and are much slower. Ticket to address that: paketo-buildpacks/builder-jammy-tiny#366

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants