Anuken / Mindustry

The automation tower defense RTS
https://mindustrygame.github.io
GNU General Public License v3.0
22.51k stars 2.95k forks source link

Fail to build with jdk-17 & windows, try run `gradlew desktop:run` #8436

Closed QZLin closed 1 year ago

QZLin commented 1 year ago

Platform: Windows 11 21H2

Task :javaToolchains

Issue: Build Fail while run gradlew desktop:run (The error was so wierd and I got no similar result on web)

Configure project :android gradle init: [buildscript.repositories] (maven13: https://maven.google.com) removed No keystore property found. Releases will be unsigned. WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the gradle.properties file or use the new publishing DSL.

Configure project :desktop Scheduling sprite packing.

Task :core:kaptKotlin java.lang.IllegalAccessError: class mindustry.annotations.util.AnnotationProxyMaker (in unnamed module @0x5080f9f8) cannot access class sun.reflect.annotation.AnnotationParser (in module java.base) because module java.base does not export sun.reflect.annotation to unnamed module @0x5080f9f8 at mindustry.annotations.util.AnnotationProxyMaker.generateAnnotation(AnnotationProxyMaker.java:45) at mindustry.annotations.util.AnnotationProxyMaker.generateAnnotation(AnnotationProxyMaker.java:41) at mindustry.annotations.util.Selement.annotation(Selement.java:72) at mindustry.annotations.entity.EntityProcess.getDependencies(EntityProcess.java:1010) at mindustry.annotations.entity.EntityProcess.getDependencies(EntityProcess.java:1007) at mindustry.annotations.entity.EntityProcess.getDependencies(EntityProcess.java:1007) at mindustry.annotations.entity.EntityProcess.getDependencies(EntityProcess.java:1007) at mindustry.annotations.entity.EntityProcess.getDependencies(EntityProcess.java:1007) at mindustry.annotations.entity.EntityProcess.process(EntityProcess.java:114) at mindustry.annotations.BaseProcessor.process(BaseProcessor.java:225) at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.process(incrementalProcessors.kt:90) at org.jetbrains.kotlin.kapt3.base.ProcessorWrapper.process(annotationProcessing.kt:188) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:1023) ...... C:**\Project\Mindustry-dev\core\src\mindustry\logic\Ranged.java:5: error: symbol not found public interface Ranged extends Posc, Teamc{ ^ Symbol: class Posc ...... warning: Supported source version 'RELEASE_8' from annotation processor 'org.jetbrains.kotlin.kapt3.base.ProcessorWrapper' less than -source '17'

FAILURE: Build failed with an exception.

Steps to reproduce: (Everytimes try to build)

Link(s) to mod(s) used: -

Save file: (Fail to build)

(Crash) logs: -


Anuken commented 1 year ago

This log doesn't make sense (I have export flags to prevent that error), and as JDK 17 works fine on the CI, locally, and for everyone else, I would guess it's an issue with your JDK. Use a different one. I've never had this issue.

QZLin commented 1 year ago

This log doesn't make sense (I have export flags to prevent that error), and as JDK 17 works fine on the CI, locally, and for everyone else, I would guess it's an issue with your JDK. Use a different one. I've never had this issue.

There's nothing wrong with JDK, I have tried a lot (Microsoft JDK-17 (17.06,17.04), JetBrains JDK-17, Adopt JDK-17... etc And tried Cl with ubuntu/windows, everything is fine except my computer.

Finally, I found that my $GRADLE_HOME/.properties setting JVM proxy via org.gradle.jvmargs=-DsocksProxyHost\=*** -DsocksProxyPort\=*** seems overrides the export flags from project gradle properties. (Never thought about that) After removing that line, the build successes.