Skip to content

Conversation

shs96c
Copy link
Contributor

@shs96c shs96c commented Apr 14, 2021

Without opening the util package, the following is seen when compiling
Kotlin code:

INFO: From Executing genrule //src/main/kotlin/io/bazel/kotlin/plugin/jdeps:jdeps-gen-lib_jar [for host]:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil to method java.util.ResourceBundle.setParent(java.util.ResourceBundle)
WARNING: Please consider reporting this to the maintainers of com.intellij.util.ReflectionUtil
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

This is a known issue in kotlin, for some versions of kotlin on some
versions of the JDK: https://youtrack.jetbrains.com/issue/KT-43704

The downside with the flag is that it's Java 9+ only, but since Bazel
requires Java 11 to run, this seems like a reasonable assertion to
make.

Without opening the util package, the following is seen when compiling
Kotlin code:

```
INFO: From Executing genrule //src/main/kotlin/io/bazel/kotlin/plugin/jdeps:jdeps-gen-lib_jar [for host]:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil to method java.util.ResourceBundle.setParent(java.util.ResourceBundle)
WARNING: Please consider reporting this to the maintainers of com.intellij.util.ReflectionUtil
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
```

This is a known issue in kotlin, for some versions of kotlin on some
versions of the JDK: https://youtrack.jetbrains.com/issue/KT-43704

The downside with the flag is that it's Java 9+ only, but since Bazel
requires Java 11 to run, this seems like a reasonable assertion to
make.
@cgruber
Copy link
Collaborator

cgruber commented Jul 10, 2021

I went to merge this, but it's breaking on OpenJDK8 on RBE with

Unrecognized option: --add-opens
--
Error: Could not create the Java Virtual Machine.

@cgruber
Copy link
Collaborator

cgruber commented Jul 10, 2021

Is the RBE-on-Java8 actually running bazel on java8?

@cgruber cgruber added this to the Candidate 1.5 milestone Jul 10, 2021
@cgruber cgruber added component: jvm P2 status: in review Solution being reviewed type: cleanup Refactorings, idiomatic transforms, tech debt payoff labels Jul 10, 2021
@arunkumar9t2
Copy link
Contributor

Is the RBE-on-Java8 actually running bazel on java8?

Seems like yes.

CMD="/usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xmx256M -Xms32M -noverify       --add-opens java.base/java.util=ALL-UNNAMED

Could be because of

"@bazel_tools//tools/jdk:current_host_java_runtime",

I think it should be using "@bazel_tools//tools/jdk:current_java_runtime" instead of "@bazel_tools//tools/jdk:current_host_java_runtime".

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

Labels

component: jvm P2 status: in review Solution being reviewed type: cleanup Refactorings, idiomatic transforms, tech debt payoff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants