我在 Spring Shell 中执行命令时遇到问题。我正在使用此代码在 Raspberry PI 上闪烁 LED,但在 Tomcat 的日志中出现响应错误。
JLineShellComponent shell;
Bootstrap bootstrap = new Bootstrap();
shell = bootstrap.getJLineShellComponent();
shell.executeCommand("gpio -g write 17 1");
shell.stop();
日志输出为:
org.springframework.shell.core.SimpleParser commandNotFound
WARNING: Command 'sudo gpio -g write 17 1' not found (for assistance press TAB)
当我使用echo
命令时,问题仍然存在。