Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harmless illegal reflective access warning with JDK 11 (but not 8 or 17+) #12957

Closed
xuwei-k opened this issue Feb 23, 2024 · 7 comments · Fixed by scala/scala#10717
Closed

Harmless illegal reflective access warning with JDK 11 (but not 8 or 17+) #12957

xuwei-k opened this issue Feb 23, 2024 · 7 comments · Fixed by scala/scala#10717
Assignees
Milestone

Comments

@xuwei-k
Copy link

xuwei-k commented Feb 23, 2024

$ java --version 
openjdk 11.0.21 2023-10-17 LTS
OpenJDK Runtime Environment Zulu11.68+17-CA (build 11.0.21+9-LTS)
OpenJDK 64-Bit Server VM Zulu11.68+17-CA (build 11.0.21+9-LTS, mixed mode)
$ scala          
Welcome to Scala 2.13.13 (OpenJDK 64-Bit Server VM, Java 11.0.21).
Type in expressions for evaluation. Or try :help.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jline.terminal.impl.exec.ExecTerminalProvider$ReflectionRedirectPipeCreator to constructor java.lang.ProcessBuilder$RedirectPipeImpl()
WARNING: Please consider reporting this to the maintainers of org.jline.terminal.impl.exec.ExecTerminalProvider$ReflectionRedirectPipeCreator
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
@SethTisue SethTisue added this to the 2.13.14 milestone Feb 23, 2024
@SethTisue SethTisue self-assigned this Feb 23, 2024
@SethTisue
Copy link
Member

cause is jline/jline3#862 , so we may need to move to JLine 3.25.1 in order to fix it 😕

@SethTisue SethTisue changed the title illegal reflective access warning with JDK 11 illegal reflective access warning with JDK 11 (but not 8 or 17+) Feb 23, 2024
@SethTisue
Copy link
Member

At least it's specific to 11! Doesn't happen on 8, 17, or 21.

@SethTisue SethTisue changed the title illegal reflective access warning with JDK 11 (but not 8 or 17+) Harmless illegal reflective access warning with JDK 11 (but not 8 or 17+) Feb 23, 2024
@SethTisue
Copy link
Member

Also the REPL seems to work fine anyway, at least as far as I can tell — I've added “harmless” to the issue title, hopefully I won't have to remove it again 🤞

@hamzaremmal
Copy link
Member

hamzaremmal commented Feb 26, 2024

@SethTisue FYI: Scala 3 has been updated to used JLine 3.25.1 (in scala/scala3#19744)

@irisTa56
Copy link

I encountered the same kind of warning when I used HEAD of Scala 2.13.x branch. (I'm using macOS 14.4.1)

sbt:root> scala
[info] running (fork) scala.tools.nsc.MainGenericRunner -usejavacp
Welcome to Scala 2.13.14-20240410-192757-770e6a0 (OpenJDK 64-Bit Server VM, Java 11.0.22).
Type in expressions for evaluation. Or try :help.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jline.terminal.impl.exec.ExecTerminalProvider$ReflectionRedirectPipeCreator (file:/Users/takayuki.kobayashi/Documents/_repos/scala/target/bg-jobs/sbt_86d39714/target/34c75c8d/1c1c671a/jline-3.25.1.jar) to constructor java.lang.ProcessBuilder$RedirectPipeImpl()
WARNING: Please consider reporting this to the maintainers of org.jline.terminal.impl.exec.ExecTerminalProvider$ReflectionRedirectPipeCreator
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

The warning seems the same as the one I saw in v2.13.13.

sbt:root> scala
[info] running (fork) scala.tools.nsc.MainGenericRunner -usejavacp
Welcome to Scala 2.13.13-20240221-035612-fcc67cd (OpenJDK 64-Bit Server VM, Java 11.0.22).
Type in expressions for evaluation. Or try :help.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jline.terminal.impl.exec.ExecTerminalProvider$ReflectionRedirectPipeCreator (file:/Users/takayuki.kobayashi/Documents/_repos/scala/target/bg-jobs/sbt_60ac3d2e/target/852a93e8/04359738/jline-3.24.1.jar) to constructor java.lang.ProcessBuilder$RedirectPipeImpl()
WARNING: Please consider reporting this to the maintainers of org.jline.terminal.impl.exec.ExecTerminalProvider$ReflectionRedirectPipeCreator
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Since JLine v3.24.1 already has jline/jline3#862, I think it seems related to jline/jline3#951.

Note that for sbt, I could suppress the warning by setting the system property sbt/sbt#7505 (comment), but it didn't take effect for scala inside sbt.

@SethTisue
Copy link
Member

@irisTa56 perhaps it will go away once sbt takes the 3.25.1 upgrade — we're pursuing it at sbt/sbt#7500

I don't see the warning if I sbt dist/mkPack followed by ./build/pack/bin/scala

currently the REPL you get from scala command inside sbt in the Scala 2 build is messed up anyway, as per scala/scala-dev#755

@irisTa56
Copy link

@SethTisue
Thank you for your reply.
I will wait for the sbt upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants