Error building X86 image: The Java VM jamvm failed

checking for gmp.h... yes
checking jni_md.h support... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for mkdir... /bin/mkdir
checking for cp... /home/de/openwrt/staging_dir/host/bin/cp
checking for date... /bin/date
checking for find... /home/de/openwrt/staging_dir/host/bin/find
checking for zip... /home/de/openwrt/staging_dir/host/bin/zip
checking for a jar-like tool... trying fastjar, gjar and jar
checking for fastjar... no
checking for gjar... no
checking for jar... /usr/lib/jvm/java-8-openjdk-amd64/bin/jar
checking whether to regenerate parsers with jay... no
checking for stdint types... stdint.h (shortcircuit)
make use of stdint.h in include/config-int.h (assuming C99 compatible system)
checking for cacao... no
checking for jamvm... jamvm
checking for ecj... no
checking for ecj-3.3... no
checking for ecj-3.2... no
checking for javac... javac -Xlint:unchecked,cast,divzero,empty,finally,overrides
checking if javac -Xlint:unchecked,cast,divzero,empty,finally,overrides is a version of gcj... no
checking if javac -Xlint:unchecked,cast,divzero,empty,finally,overrides works... yes
checking for uudecode... yes
checking if uudecode can decode base 64 file... yes
checking if jamvm works... configure: error: The Java VM jamvm failed (see config.log, check the CLASSPATH?)
Makefile:94: recipe for target '/home/de/openwrt/build_dir/target-x86_64_musl/classpath-0.99/.configured_68b329da9893e34099c7d8ad5cb9c940' failed
make[3]: *** [/home/de/openwrt/build_dir/target-x86_64_musl/classpath-0.99/.configured_68b329da9893e34099c7d8ad5cb9c940] Error 1
make[3]: Leaving directory '/home/de/openwrt/feeds/packages/libs/classpath'
time: package/feeds/packages/classpath/compile#4.99#3.23#11.16
package/Makefile:111: recipe for target 'package/feeds/packages/classpath/compile' failed
make[2]: *** [package/feeds/packages/classpath/compile] Error 2
make[2]: Leaving directory '/home/de/openwrt'
package/Makefile:107: recipe for target '/home/de/openwrt/staging_dir/target-x86_64_musl/stamp/.package_compile' failed
make[1]: *** [/home/de/openwrt/staging_dir/target-x86_64_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/de/openwrt'
/home/de/openwrt/include/toplevel.mk:225: recipe for target 'world' failed
make: *** [world] Error 2
de@ubuntu:~/openwrt$

jamvm is missing.

Here is how to fix it:

checking if uudecode can decode base 64 file... yes
checking if jamvm works... configure: error: The Java VM jamvm failed (see config.log, check the CLASSPATH?)
Makefile:94: recipe for target '/home/de/openwrt/build_dir/target-x86_64_musl/classpath-0.99/.configured_68b329da9893e34099c7d8ad5cb9c940' failed
make[3]: *** [/home/de/openwrt/build_dir/target-x86_64_musl/classpath-0.99/.configured_68b329da9893e34099c7d8ad5cb9c940] Error 1
make[3]: Leaving directory '/home/de/openwrt/feeds/packages/libs/classpath'
time: package/feeds/packages/classpath/compile#5.00#3.10#10.84
package/Makefile:111: recipe for target 'package/feeds/packages/classpath/compile' failed
make[2]: *** [package/feeds/packages/classpath/compile] Error 2
make[2]: Leaving directory '/home/de/openwrt'
package/Makefile:107: recipe for target '/home/de/openwrt/staging_dir/target-x86_64_musl/stamp/.package_compile' failed
make[1]: *** [/home/de/openwrt/staging_dir/target-x86_64_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/de/openwrt'
/home/de/openwrt/include/toplevel.mk:225: recipe for target 'world' failed
make: *** [world] Error 2
de@ubuntu:~/openwrt$ make clean

de@ubuntu:~/openwrt$ echo $JAVA_HOME
/usr/lib/jvm/java-8-openjdk-amd64
de@ubuntu:~/openwrt$ echo $PATH
/usr/lib/jvm/java-8-openjdk-amd64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
de@ubuntu:~/openwrt$ $echo $CLASSPATH
-bash: .:/usr/lib/jvm/java-8-openjdk-amd64/lib:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib: No such file or directory
de@ubuntu:~/openwrt$