的Beanshell文檔意味着您可以使用命令行格式運行腳本:使用args []將Java Beanshell腳本編寫到程序中?
java bsh.Interpreter script.bsh [args]
與此唯一的問題是,我不能讓它開始工作。我知道如何使用來自Beanshell腳本的參數調用其他腳本,但我無法獲取初始腳本來引用參數。幫幫我?
例如,像這樣的一個BeanShell的腳本,不會解析ARGS:
import java.util.*;
for (int i=0; i < args.length; i++) {
System.out.println("Arg: " + args[i]);
}
而且,這並不工作之一:
import bsh.Interpreter;
for(i : bsh.args)
System.out.println(i);
你知道如何將bsh.args轉儲到屏幕? – djangofan
工作。謝謝。 – djangofan