Maximum JDK requirement...?


#1

Getting this build error, and near as I can tell from Google searching, my version of Java (latest) is maybe too new for the Trigger/Forge build tools? I hope that’s just wild internet speculation.

[ERROR] Failed when running java: Exception in thread “main” java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder
at com.android.sdklib.internal.build.SignedJarBuilder.(SignedJarBuilder.java:172)
at io.trigger.forge.ApkSigner.main(ApkSigner.java:125)
Caused by: java.lang.ClassNotFoundException: sun.misc.BASE64Encoder
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
… 2 more
[DEBUG] Traceback (most recent call last):
File “/Users/chris/Library/Trigger Toolkit/build-tools/forge/async.py”, line 106, in run
result = self._target(*self._args, **self._kwargs)
File “/Users/chris/Library/Trigger Toolkit/trigger/api/app.py”, line 327, in run
forge_main.run([’–general.interactive’, ‘no’])
File “/Users/chris/Library/Trigger Toolkit/build-tools/forge/main.py”, line 461, in run
build_to_run=build_to_run,
File “/Users/chris/code/diaryApp/.template/generate_dynamic/customer_goals.py”, line 148, in run_app
build_to_run.run()
File “/Users/chris/code/diaryApp/.template/generate_dynamic/build.py”, line 347, in run
self._call_with_params(task_method, task_args)
File “/Users/chris/code/diaryApp/.template/generate_dynamic/build.py”, line 306, in _call_with_params
return method(self, *params)
File “/Users/chris/code/diaryApp/.template/generate_dynamic/android_tasks.py”, line 675, in run_android
create_apk(build, out_apk_name, interactive=interactive)
File “/Users/chris/code/diaryApp/.template/generate_dynamic/android_tasks.py”, line 614, in create_apk
_sign_zipf_debug(lib_path, jre, stage1, stage2)
File “/Users/chris/code/diaryApp/.template/generate_dynamic/android_tasks.py”, line 469, in _sign_zipf_debug
zipf_name=zipf_name,
File “/Users/chris/code/diaryApp/.template/generate_dynamic/android_tasks.py”, line 456, in _sign_zipf
run_shell(*args)
File “/Users/chris/code/diaryApp/.template/generate_dynamic/module_dynamic/utils.py”, line 365, in run_shell
output=state.output.getvalue()
ShellError: Failed when running java: Exception in thread “main” java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder
at com.android.sdklib.internal.build.SignedJarBuilder.(SignedJarBuilder.java:172)
at io.trigger.forge.ApkSigner.main(ApkSigner.java:125)
Caused by: java.lang.ClassNotFoundException: sun.misc.BASE64Encoder
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
… 2 more

Status: failed
Show debug


Failed when running java: Exception in thread "main" java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder
#2

Known issue:


#3

Gotcha, thanks. Researching how to ACTUALLY remove Java 12 and drop back to 8, because holy crap, what a mess Java makes of your hard drive.

I fell completely out of love, hard, with Java the first time I heard someone say “just add these frameworks, and…”


#4

@chornbe : Did you manage to resolve this issue? How did you downgrade Java version ?