Thanks, Mike. So I removed gradle.properties (I never edited anything
in there), and re-run, and I can see that I now have

# We also open up internal compiler modules for spotless/ google jaa format.
org.gradle.jvmargs=-Xmx3g \
 --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
 --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
 --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
 --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
 --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED


which seems as if it ought to fix, but I got the same error -- OH --
but not the second time??! wacky, but (crossing fingers) I hope it
will stay fixed now

On Wed, Apr 6, 2022 at 4:56 PM Mike Drob <md...@mdrob.com> wrote:
>
> Save a copy of your gradle.properties and then rerun. There are add opens 
> options in the jvm opts we generate that were not there before
>
> On Wed, Apr 6, 2022 at 3:46 PM Michael Sokolov <msoko...@gmail.com> wrote:
>>
>> OK, this also happens with Oracle's JDK17. Now I'm confused
>>
>> On Wed, Apr 6, 2022 at 4:28 PM Michael Sokolov <msoko...@gmail.com> wrote:
>> >
>> > Hi, locally I failed to run spotlessCheck/spotlessApply on main (10.x)
>> > branch. I assume it's because of a JVM difference; here's the error:
>> >
>> >
>> > Step 'google-java-format' found problem in
>> > 'lucene/core/src/java/module-info.java':
>> > null
>> > java.lang.reflect.InvocationTargetException
>> >         at 
>> > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
>> > Method)
>> >
>> >         [giant gradle stack trace omitted]
>> >
>> > Caused by: java.lang.IllegalAccessError: class
>> > com.google.googlejavaformat.java.JavaInput (in unnamed module
>> > @0x1430dc06) cannot access class
>> > com.sun.tools.javac.parser.Tokens$TokenKind (in module jdk.compiler)
>> > because module jdk.compiler does not export com.sun.tools.javac.parser
>> > to unnamed module @0x1430dc06
>> >         at 
>> > com.google.googlejavaformat.java.JavaInput.buildToks(JavaInput.java:349)
>> >         at 
>> > com.google.googlejavaformat.java.JavaInput.buildToks(JavaInput.java:334)
>> >         at 
>> > com.google.googlejavaformat.java.JavaInput.<init>(JavaInput.java:276)
>> >         at 
>> > com.google.googlejavaformat.java.Formatter.getFormatReplacements(Formatter.java:280)
>> >         at 
>> > com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:267)
>> >         at 
>> > com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:233)
>> >
>> > It seems like a no-no for Google to be relying on Sun packages, but IDK
>> >
>> > I tried changing
>> >
>> > >  id 'com.diffplug.spotless' version "6.4.2" apply false
>> >
>> > in build.gradle
>> >
>> > and
>> >
>> > > googleJavaFormat('1.15.0')
>> >
>> > in spotless.gradle
>> >
>> >  (the newest versions), because why not, but it didn't seem to help.
>> >
>> > Any idea how to fix? If it's a problem with my JDK, is there a thing I
>> > can ask to have changed in that? Re-export the com.sun.tools.javac
>> > package I guess?
>> >
>> > -Mike
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
>> For additional commands, e-mail: dev-h...@lucene.apache.org
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to