Ant 中的 Beanshell 产生“无法为 beanshell 创建 javax 脚本引擎" [英] Beanshell in Ant yielding, "Unable to create javax script engine for beanshell"
问题描述
您好,我正在尝试将一些 Beanshell 脚本放入我的 Ant build.xml 文件中.我已经尽可能地遵循了 Ant 手册,但是当我运行 Ant 时,我一直收到无法为 beanshell 创建 javax 脚本引擎"的消息.以下是我主要根据 Ant 手册中的示例编写的测试目标:
Greeting, I'm trying to put some Beanshell script in my Ant build.xml file. I've followed the Ant manual as well as I can but I keep getting "Unable to create javax script engine for beanshell" when I run Ant. Here is the test target I wrote mostly from examples in the Ant manual:
<target name="test-target">
<script language="beanshell" setbeans="true">
<classpath>
<fileset dir="c:\TEMP" includes="*.jar" />
</classpath>
System.out.println("Hello world");
</script>
</target>
我的 beanshell "bsh-2.0b4.jar" 文件位于脚本任务的类路径中,就像手册推荐的那样.希望我有正确的文件.我现在在 c:\TEMP 工作.我一直在谷歌搜索并尝试了一段时间.任何想法将不胜感激.谢谢.
My beanshell "bsh-2.0b4.jar" file is on the script task's classpath the way the manual recommended. Hope I have the right file. I'm working in c:\TEMP right now. I've been googling and trying for a while now. Any ideas would be greatly appreciated. Thanks.
推荐答案
首先,您需要从这里获取 jsr-engines.zip:
First, you need jsr-engines.zip from here:
https://scripting.dev.java.net/servlets/ProjectDocumentList
在里面,你会找到 jsr223/beanshell/build/bsh-engine.jar.一些搜索暗示您需要下载bsh-2.05b.jar.我在这里找到了:
Inside, you'll find jsr223/beanshell/build/bsh-engine.jar. Some searching implied that you need to download bsh-2.05b.jar. I found it here:
http://beanshell.org/bsh-2.0b5.jar
更容易找到的 bsh-2.0b4.jar 似乎也有效,但它打印出一条消息,暗示它是实验性的.
The more easily findable bsh-2.0b4.jar also seemed to work, but it printed a message that implied it was experimental.
这篇关于Ant 中的 Beanshell 产生“无法为 beanshell 创建 javax 脚本引擎"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!