下面是BeanShell的快速入门文档地址。
http://www.beanshell.org/manual/bshmanual.html#Quick_Start
Quick Start
Welcome to BeanShell. This is a crash course to get you going. We'll leave out many important options and details. Please see the rest of the user's guide for more information.
Download and Run BeanShell
Download the latest JAR file from http://www.beanshell.org and start up BeanShell either in the graphical desktop mode or on the command line.
If you just want to start playing around you may be able to launch the BeanShell desktop by simply double clicking on the BeanShell JAR file. More generally however you'll want to add the jar to your classpath so that you can work with your own classes and applications easily.
To do this you can either drop the BeanShell JAR file into your Java extensions folder or add it to your classpath. (Important: If you put BeanShell in the extensions folder and wish to use it with BSF applications like Jakarta Ant you must install the bsf.jar in the same location).
下面是安装方法:
To install as an extension place the bsh.jar file in your
$JAVA_HOME/jre/lib/ext folder. (OSX users: place the bsh.jar in
/Library/Java/Extensions or ~/Library/Java/Extensions for individual users.)
Or add BeanShell to your classpath like this:
unix: export CLASSPATH=$CLASSPATH:bsh-xx.jar
windows: set classpath %classpath%;bsh-xx.jar
运行BeanShell开发界面
You can then run BeanShell in either a GUI or command line mode:
图形界面
java bsh.Console // run the graphical desktop
or
命令行界面
java bsh.Interpreter // run as text-only on the command line
or
java bsh.Interpreter filename [ args ] // run script file
上面是官方的安装方法。或许你安装的时候会遇到一些问题。我也是,在这里把我遇到的问题贴出来,供各位看官借鉴。
首先,如果你的系统变量中只设置了JAVA_HOME和Path两个变量,当你在命令行下运行java bsh.Console的时候会提示说找不到活不能加载类的提示(NotClassDefaultFoundException),你应该将classpath这个变量加上去。例如我的系统中的三个变量分别如下:
JAVA_HOME:D:\Program Files\Java\jdk1.6.0_21
Path:%JAVA_HOME%bin
classpath:.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\toos.jar;%JAVA_HOME%\jre\lib\ext\bsh.jar;
注意classpath后面的%JAVA_HOME%\jre\lib\ext\bsh.jar;,最后的分号是要的,bsh.jar是要加到类路径下的(当然下的jar包可能是bsh-xx.jar),我的是将版本号给去掉了的。
这样,运行java bsh.Console就没有问题了。如果还是不行,如果你装的是JDK7,可能是JDK7本身的问题,换成JDK6试试吧。下面有JAVA_HOME,Path,classpath这三个变量的详细解释
http://blog.jrj.com.cn/2797406448,5365872a.html
分享到:
相关推荐
BeanShell快速入门
BeanShell快速入门.pdf
BeanShell BeanShell
保存本地文件会把逐次请求的不同参数的结果分别保存。...BeanShell PostProcessor每次可以打开相同文件,在一个文件上 追加 写入 。可以实现存到同一文件中。 注意:保存结果到本地,也要创建***正则提取器***哦~~
beanshell和jdom的jar包 BeanShell执行标准Java语句和表达式,另外包括一些脚本命令和语法
beanshell 源码 jar doc sound
JMeter beanShell修改http请求参数,尝试对http进行修改。
什么是BeanShell BeanShell是一个小型的,免费的,可嵌入式的,具有面向对象脚本语言特性的Java代码解释器。简而言之,BeanShell可以动态的解释JAVA语言。...直接在 Java 中使用 JavaScript 的功能
BeanShell用户手册,官网原版,英文版本 BeanShell User's Manual 对应版本bsh_2.0b4.jar
BeanShell帮助文档pdf和jar包
how to use beanshell to debug java application
jmeter配置原件BeanShell使用方法场景介绍,Jmeter常用内置变量及方法介绍
很好的脚本语言,解析java数学表达式非常有用,
beanshell 必需的jar bsh-2.0b4.jar bsf.jar
beanshell的使用,介绍以及源码
maven-script-beanshell-3.2.jar
maven-script-beanshell-2.0.11.jar
呵呵 我在看ofbiz的时候用到的beanshell 也是在网上搜索的 希望对大家有用