问题描述
我试着在本教程之后使用Jython运行HtmlUnit:
I tried to run HtmlUnit with Jython following this tutorial:
但它对我不起作用。我无法导入 com.gargoylesoftvare 包,HtmlUnit文件夹中只有一些HTML文件,我需要以某种方式导入?
but it does not work for me. I am unable to import the com.gargoylesoftvare packages, there are only some HTML files in HtmlUnit folder, which I need to import somehow?
该教程说要像这样运行python脚本:
The tutorial says to run python script like this:
/opt/jython/jython -J-classpath "htmlunit-2.8/lib/*" gartner.py
我尝试运行:
java -jar /Users/adam/jython/jython.jar -J-classpath "htmlunit-2.8/lib/*" gartner.py
我的问题是我得到一个未知选项:J-classpath。但是在Jython.org上甚至没有关于-J-classpath参数的说法。我会非常高兴任何建议。我在Snow Leopard上运行jython standalone v.2.5.2
My problem is I am getting an "Unknown option: J-classpath". But there is not even word about -J-classpath parameter on Jython.org. I would be VERY glad for any advice. I am running jython standalone v. 2.5.2 on Snow Leopard
推荐答案
您的整个命令行正由<$ c处理$ c> java 命令(应该如此),而 -J-classpath 确实不是 java $ c的有效命令行选项$ C>。您应该尝试按照本教程的确切步骤进行操作,因为您缺少几个重要步骤(并且有点自己的步骤)。
Your entire command line is being processed by the java
command (as it should), and -J-classpath is indeed not a valid command line option for java
. You should really try to follow the exact steps of the tutorial, because you are missing several important steps (and kind of making up your own steps).
这篇关于使用Jython运行HtmlUnit - 在命令行上启动问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!