'iMac Apple M1 Chip macOS Monterey Java Error for RJDemetra Package in RStudio

I have been using this computer for 3 days. I installed Java from official website. And then i installed the package "RJDemetra" for seasonal adjustments. When i try to activate package i see this warning message on screen.

Error: package or namespace load failed for ‘RJDemetra’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(jli, FALSE)
error: shared object '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib' could not be loaded:
dlopen(/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib, 0x000A): tried: '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

I am not an advanced Apple Computer user. I have tried all of the suggestions before, did not work.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source