Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

jline triggers a restricted method warning on modern JVMs

Chiusa
#1 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
clojure, java
Ambito
cli

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

[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+.

Lingua principale
Clojure
Stelle
20
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di clojure/clojure-cli.repl

Tutte le issue di clojure/clojure-cli.repl

Issue simili

Altre issue su Clojure

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.