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

Reflective access on Java 11 #6299

Closed
marekjelen opened this issue Jun 26, 2020 · 1 comment
Closed

Reflective access on Java 11 #6299

marekjelen opened this issue Jun 26, 2020 · 1 comment

Comments

@marekjelen
Copy link

marekjelen commented Jun 26, 2020

Hello,

on JRuby version

jruby 9.2.11.1 (2.5.7) 2020-03-25 b1f55b1a40 OpenJDK 64-Bit Server VM 11.0.7+10-LTS on 11.0.7+10-LTS +jit [darwin-x86_64]

the following code

java_import java.net.http.HttpClient
java_import java.time.Duration

builder = HttpClient.new_builder
builder.followRedirects(HttpClient::Redirect::NORMAL)
builder.connectTimeout(Duration.ofSeconds(20))
@client = builder.build

fails with

TypeError: illegal access on 'build': class org.jruby.javasupport.JavaMethod (in module org.jruby.dist) cannot access class jdk.internal.net.http.HttpClientBuilderImpl (in module java.net.http) because module java.net.http does not export jdk.internal.net.http to module org.jruby.dist

When the package is opened, it works fine.

--add-opens java.net.http/jdk.internal.net.http=org.jruby.dist

However, is it really necessary for JRuby to require access to the internal package?

Thanks

@headius
Copy link
Member

headius commented Jun 26, 2020

Same issue as #6287, which is fixed for 9.2.12.0.

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

No branches or pull requests

2 participants