gradle
How to enable Java 12 preview features with Gradle?
You need to configure the JavaCompile tasks, so that Gradle passes this option to the Java compiler when compiling. Something like this should work: tasks.withType(JavaCompile).each { it.options.compilerArgs.add(‘–enable-preview’) } To run the app/tests we need to add jvmArgs. Example: test { jvmArgs([‘–enable-preview’]) }
java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector cannot access class com.sun.tools.javac.code.Symbol$
It took me up to 3 working days and I found a simple solution. Go to android/gradle.properties change org.gradle.jvmargs=-Xmx1536M to org.gradle.jvmargs=-Xmx1536M –add-exports=java.base/sun.nio.ch=ALL-UNNAMED –add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED –add-opens=java.base/java.lang.reflect=ALL-UNNAMED –add-opens=java.base/java.io=ALL-UNNAMED –add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
What are the differences between uberJar, fatJar and shadowJar in Gradle?
The terms are sometimes used interchangeably, but usually refers to: Fat jar (also named Uber jar) – used to describe a jar that has all classes from dependent jars zipped directly inside it in the correct directory structure, and not in other jars. There is a good explanation here. Shaded jar (or shaded classes) – … Read more