-
Notifications
You must be signed in to change notification settings - Fork 121
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
Java 9 WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil #459
Comments
I am getting something different:
I already use sbt |
On JDK10:
|
this is getting annoying. is there a way to suppress this warning? Also i get that error even with jdk8. the problem is if jdk9 or 10 its installed at all |
This error shows up as part of the standard Scala Hello World tutorial from https://docs.scala-lang.org/getting-started-sbt-track/getting-started-with-scala-and-sbt-on-the-command-line.html running against the latest JDK 10. Speaking on behalf of Scala noobs everywhere – this feels alarming! It's probably not a good idea to amend the tutorial to say "ignore this warning", because ignoring warnings is not a habit people should be getting into. Getting to the root of the problem and fixing it is a little beyond me right now, though.
|
Also getting this on JVM 11. |
protocolbuffers/protobuf#3781 has been fixed! |
Nice. |
I'm getting the same error as #459 (comment) which seems to be coming from https://github.com/sbt/zinc/blob/develop/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/javac/DiagnosticsReporter.scala#L115
Looks like the reflection there is a pretty old line 3f92b2b#diff-9b267fe75b6831da3dca25ceb91082e9R75 - before the Java 9 release date, so seems likely it's just not compatible. |
Looks like protocolbuffers/protobuf#5812 got fixed and 3.7.0 can be used now! |
Fix #459: Upgrade protobuf to 3.7.0 to get rid of Java 9+ warnings
This issue was not actually fixed by this change because the zinc-persist and zinc-core still have a transitive dependency on scalapb-runtime:0.6.0. The warnings are still printed with java 9 using sbt 1.3.0-M2. |
The head of scalapb-runtime updates the dependency to 3.7.0.1, but they haven't made a release yet. I opened up an issue: scalapb/ScalaPB#559. |
Hey all, ScalaPB has 0.9.0-RC1 which depends on protobuf-java 3.7.0. Note that you are using a very old version of ScalaPB and we had an artifact name change since then. Migration instructions are here: https://scalapb.github.io/migrating.html In the past, zinc dependncy on ScalaPB caused issues to SBT users that use ScalaPB since they might end up with incompatible versions of ScalaPB or protobuf. It would be great to add some integration tests to SBT to ensure an updated zinc/sbt doesn't cause a regression to ScalaPB users. |
The same dependencyOverrides that was added in zinc needs to be added in sbt: bc7a8f5
Upgrading scalapb in zinc is apparently verboten due to unfortunate technical decisions: #546, though there's one proposal to get out of this mess: sbt/sbt#4183 |
@smarter I still maintain that this is a zinc issue because we are forcing every downstream consumer of zinc to manually override the protobuf-java dependency. |
I am happy to explore all avenues:
|
Resolved by #647 |
Using just released sbt
OpenJDK 11:
You should be able to reproduce this by using the
|
A separate issue should be opened for that (also someone should run sbt with |
steps
Run on Java 9.
problem
expectation
No warnings
notes
See protocolbuffers/protobuf#3781
The text was updated successfully, but these errors were encountered: