Ask Your Question
0

java.lang.NoClassDefFoundError during linux build for Android (SOLVED) [closed]

asked 2018-03-02 20:50:10 -0500

9261 gravatar image

updated 2018-03-02 21:31:37 -0500

I am trying to use the build_sdk.py script to compile opencv4android. It seems to build the o4a folder without problems, but eventually the script exits with the following output:

Target '-package' failed with message 'The following error occurred while executing this line: /home/user/Android/Sdk/tools/ant/build.xml:969: The following error occurred while executing this line: /home/user/Android/Sdk/tools/ant/build.xml:312: java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder'. Cannot execute '-do-debug' - '-package' failed or was not executed. Cannot execute 'debug' - '-do-debug' failed or was not executed.

I did some research, and this seems to happen because java 9 has removed the BASE64encoder class, but my JAVA_HOME environment variable points to a java 8 jdk. I am using jdk 8u161 and ant version 1.9.10

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by 9261
close date 2018-05-12 14:18:17.039678

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-03-02 21:07:05 -0500

9261 gravatar image

I forgot to update my command prompt, this is solved and will be closed soon

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-03-02 20:50:10 -0500

Seen: 227 times

Last updated: Mar 02 '18