Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[go-migration] Compatibility issue with existing apps due to JRE relocation in the Go-based Java Buildpack

Đang mở
#1,151 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
go, java
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu với quy trình staging của buildpack và entry point /profile.d/0_java.sh được đề cập trong issue, sau đó truy vết nơi JAVA_HOME mới được thiết lập. Tái hiện staging với đường dẫn .java-buildpack/open_jdk_jre/bin/java được hard-code và xác minh rằng cả hai đường dẫn JRE legacy đều được phân giải đến vị trí canonical, trong khi JAVA_HOME mới vẫn khả dụng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug
With the new Go-based Java Buildpack, the location of the JRE has changed:
for example, from /home/vcap/app/.java-buildpack/open_jdk_jre to the new location /home/vcap/deps/0/jre/jre-17.0.15/.
There are applications that invoke Java via a hardcoded relative path inside the droplet: .java-buildpack/open_jdk_jre/bin/java so those hardcoded paths no longer exist, which breaks apps and CF tasks that rely on that path. For example, an app used to execute CF Task to execute e.g. the DB schema (so the java is currently being invoked via the full path .java-buildpack/open_jdk_jre/bin/java). Or usages like JAVA_HOME=$PWD/.java-buildpack/open_jdk_jre JAVA_OPTS="-Djava.io.tmpdir=$TMPDIR

The new Go-based buildpack has a way to introduce $JAVA_HOME which will do the job but only for new apps (the existing apps pointing to /home/vcap/app/.java-buildpack/open_jdk_jre will fail).

Reproduction steps

  • Use an app/script that calls Java using the relative path inside the droplet, e.g.:
    .java-buildpack/open_jdk_jre/bin/java -Xms123M org.springframework.boot.loader.launch.JarLauncher
  • Stage the app using the current or the Go-migration branch of the buildpack.
  • Run the app or run a CF task that invokes the hardcoded path.
  • Observe that the app fails with No such file or directory

Expected behavior
Existing apps/CF Tasks could continue to run without modification, even if the buildpack internal JRE layout changes.

Suggested solution
Introduce compatibility shims during staging:

export JAVA_HOME=<the-new-java-location> (available in /profile.d/0_java.sh)
mkdir -p /home/vcap/app/.java-buildpack
ln -s $JAVA_HOME /home/vcap/app/.java-buildpack/open_jdk_jre
ln -s $JAVA_HOME /home/vcap/app/.java-buildpack/sap_machine_jre
  • This preserves .java-buildpack/open_jdk_jre and .java-buildpack/sap_machine_jre as a symlink to the actual JRE location.
  • $JAVA_HOME points to the canonical new location.
  • Apps with hard-coded paths will continue working.
Ngôn ngữ chính
Go
Star
452
Fork
2.5k
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
20

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cloudfoundry/java-buildpack

Tất cả issue của cloudfoundry/java-buildpack

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.