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

jline triggers a restricted method warning on modern JVMs

Cerrado
#1 1 comentario 2 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
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
clojure, java
Área
cli

Línea de trabajo

Start with the :repl alias and the clojure-cli.repl.server entry point, then trace how the spawned client receives JVM options. Reproduce the warning on JDK 27 and verify that --enable-native-access=ALL-UNNAMED reaches the client and removes the JLine warning.

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

Descripción

[edited, now that I understand more of how the CLI REPL works and the handling of aliases in tools.deps/create-basis]

Running the CLI REPL on JDK 27 yields this warning:

WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.jline.nativ.JLineNativeLoader in an unnamed module (file:/home/sean/.m2/repository/org/jline/jline/4.3.1/jline-4.3.1.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

The client needs to have this added to the alias (:attach):

           :jvm-opts ["--enable-native-access=ALL-UNNAMED"]

If you have an :attach alias in your deps.edn file, per this project's README, you can add that line and it will solve it for clojure -M:attach (as expected).

Because of the way aliases defined in multiple sources (root, user, project, extra, via -Sdeps) are handled when a basis is created, the way that the CLI REPL server starts the client (for the :repl alias) will pick up the :jvm-opts from your deps.edn file!

That is because alias definitions are merged across sources, per this Ask about aliases and sources.

As long as that behavior does not change, adding the :jvm-opts shown above to the :attach alias in deps.edn is sufficient. If that behavior changes—or users create a different alias for starting the client (@practicalli-johnny this applies to you since you used a different name in your config!)—then the server code will need updating to add the :jvm-opts when spawning the client.

I think the safest approach is to update the server code to add that, since it works on JDK17+.

Lenguaje dominante
Clojure
Estrellas
20
Forks
0
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 clojure/clojure-cli.repl

Todos los issues de clojure/clojure-cli.repl

Issues similares

Más issues de Clojure

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.