linux 从Java调用journalctl您可以使用usermod -a -G systemd-journal <username>将您的(普通)用户添加到组systemd-journal中。注销并登录到该组以使更改生效。这将使您的用户可以访问系统日志文件,而无需授予完全的root权限。对于不同的操作系统设置,组可能不同。您可以使用ls -l /
░░ The system journal process has started up, opened the journal ░░ files for writing and is now ready to process requests. May 01 06:56:38 archlinux systemd-journald[241]: Runtime Journal (/run/log/journal/3316aa776dbf450f8867a3ea5fb5241c) is 8.0M, max 795.6M, 787.6M...