jline triggers a restricted method warning on modern JVMs
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 55/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
[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+.
- Langage dominant
- Clojure
- Étoiles
- 20
- Forks
- 0
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de clojure/clojure-cli.repl
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
clojure/clojure-cli.repl#6 · 1 commentaire ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
clojure/clojure-cli.repl#5 · 1 réaction ·
Toutes les issues de clojure/clojure-cli.repl
Issues similaires
-
.Needs Triage .Team/UXWest Priority:P2 Type:Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
metabase/metabase#83998 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Add :ConjureLogShow commandOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
Install script not workingOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Clojure 1.13 compatibilityOuvertebug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
clojure-emacs/cider-nrepl#1053 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
bhauman/clojure-mcp-light#34 ·