Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#1,151 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
go, java
Área
build-system

Línea de trabajo

Comienza con el flujo de staging del buildpack y el punto de entrada /profile.d/0_java.sh mencionado en el issue; después, sigue dónde se establece el nuevo JAVA_HOME. Reproduce el staging con una ruta codificada de forma fija, .java-buildpack/open_jdk_jre/bin/java, y verifica que ambas rutas de JRE heredadas se resuelvan en la ubicación canónica mientras el nuevo JAVA_HOME siga estando disponible.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Go
Estrellas
452
Forks
2.5k
Merge medio
14 h 57 min
PR fusionados (30 d)
23

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cloudfoundry/java-buildpack

Todos los issues de cloudfoundry/java-buildpack

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.