I am trying to build AnysoftKeyboard in Android studio. I have java 9(jdk 9) and the appropriate ndk (android-ndk-r14b), as the creator in GitHub says. I have also changed the local.properties file to shows to the correct paths. Nevertheless I am still getting some errors. You can find below those errors.
Run tasks error : org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':base:compileDebugJavaWithJavac
java compiler errors : Caused by: java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: com/sun/tools/javac/util/JavacMessages$ResourceBundleHelper Caused by: java.lang.NoClassDefFoundError: com/sun/tools/javac/util/JavacMessages$ResourceBundleHelper Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.util.JavacMessages$ResourceBundleHelper
Here is a screenshot of the error : AnySoftKeyboard Compile Error , Run Tasks Error
The project uses gradle, in which I am not familiar with, so if I have missed any important step-point, please guide me to solve it.
Is there something that I am missing and getting these errors? What should I do? Thanks in advance.
After following just the official documentation I successfully built a project. I think you just forget with setting JAVA_OPTS
with adding java.se.*
source as mentioned below. And that is why you have it in stacktrace error above, with missing java.se
. resources.
To develop this project, you'll need:
Java 10 - get OpenJDK or AdoptOpenJDK.
Make sure you have the environment variable
JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
. This is required to ensure the JVM is merciful with libraries that were not designed for Java9+ JVMs.- git
- Android Studio
- Android SDK API Level 28 installed. Set up
local.properties
file to point to it (that is, ensure you havesdk.dir=/path/to/android/sdk
in it). - Android NDK r14b installed. Set up
local.properties
file to point to it (that is, ensure you havendk.dir=/path/to/android/ndk
in it).