Failed to install android-sdk: “java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema”

Just had this error, solved by downloading the Android SDK Command-line Tools (latest) on Android Studio, under Preferences > Appearance & Behavior > System Settings > Android SDK > SDK Tools and re-running flutter doctor –android-licenses Finally, add the new tools to your PATH, in your .bashrc, .zshrc or similar, before the obsolete tools: export … Read more

JDK9: An illegal reflective access operation has occurred. org.python.core.PySystemState

The ideal way to resolve this would be to reporting this to the maintainers of org.python.core.PySystemState and asking them to fix such reflective access going forward. If the default mode permits illegal reflective access, however, then it’s essential to make that known so that people aren’t surprised when this is no longer the default mode … Read more

Package conflicts with automatic modules in Java 9

Am I using the new module system correctly? Yes. What you are seeing is intended behavior, and this is because JPMS modules do not allow split packages. In case you are not familiar with the term “split packages” it essentially means two members of the same package coming from two different modules. For example: com.foo.A … Read more

What is the point of overloaded Convenience Factory Methods for Collections in Java 9

From the JEP docs itself – Description – These will include varargs overloads, so that there is no fixed limit on the collection size. However, the collection instances so created may be tuned for smaller sizes. Special-case APIs (fixed-argument overloads) for up to ten of elements will be provided. While this introduces some clutter in … Read more

What is the –release flag in the Java 9 compiler?

Not exactly. JEP 247: Compile for Older Platform Versions defines this new command-line option, –release: We defined a new command-line option, –release, which automatically configures the compiler to produce class files that will link against an implementation of the given platform version. For the platforms predefined in javac, –release N is equivalent to -source N … Read more

Failed to run sdkmanager –list with Java 9

With the help of this answer, I successfully solved the problem. We are going to apply a fix in sdkmanager. It is a shell script. It is located at $android_sdk/tools/bin, where $android_sdk is where you unzipped the Android SDK. Open sdkmanager in your favorite editor. Locate the line which sets the DEFAULT_JVM_OPTSvariable. In my copy, … Read more

JDK dateformatter parsing DayOfWeek in German locale, java8 vs java9

This seems to be there in java-9 due to the current implementation of CLDR date-time-patterns with the implementation of JEP – 252 which states that Use locale data from the Unicode Consortium’s Common Locale Data Repository (CLDR) by default. Localized patterns for the formatting and translation of display strings, such as the locale name, may … Read more

How is String concatenation implemented in Java 9?

The “old” way output a bunch of StringBuilder-oriented operations. Consider this program: public class Example { public static void main(String[] args) { String result = args[0] + “-” + args[1] + “-” + args[2]; System.out.println(result); } } If we compile that with JDK 8 or earlier and then use javap -c Example to see the … Read more

Unable to derive module descriptor for auto generated module names in Java 9?

The solution to this seems to be:- A way possible to uninterruptedly using the same artifact name with a new(different) module name could be by packaging META-INF/MANIFEST.MF of the artifact with an attribute Automatic-Module-Name which governs the name of the module to be used by the module descriptor when converted as an automatic module. OR … Read more

What is an illegal reflective access?

Apart from an understanding of the accesses amongst modules and their respective packages. I believe the crux of it lies in the Module System#Relaxed-strong-encapsulation and I would just cherry-pick the relevant parts of it to try and answer the question. What defines an illegal reflective access and what circumstances trigger the warning? To aid in … Read more