beanshell简单使用

来源:互联网 发布:photoshop6 mac破解版 编辑:程序博客网 时间:2024/05/22 09:40

 package com.beanshell;

import java.io.FileNotFoundException;
import java.io.IOException;

import bsh.EvalError;
import bsh.Interpreter;

public class TestShell {

 /**
  * @param args
  * @throws EvalError
  * @throws IOException
  * @throws FileNotFoundException
  */
 public static void main(String[] args) throws FileNotFoundException, IOException, EvalError {
  // TODO Auto-generated method stub

  Interpreter bsh = new Interpreter();
  bsh.source("src/com/beanshell/test.bsh");
 }

}

 

test.bsh:

 

f = 2*2;
print("==========f="+f);

 

原创粉丝点击