The solution to this situation is signature, which gives jar the right to execute this kind of code. After signing, jar can run functions supported by signature, and when jar executes these functions, there will be no exception.
No signature is required. Because few people will build a platform that meets their own needs by modifying the underlying java code, this higher or lower level function is usually realized by using jar packages. If you don't need this jar package, you don't have to sign it at all. If you have to use it, you basically have to sign it.
Simply put, signature is usually to obtain the executive right to perform sensitive functions.