Java 在debain 6.0.1 amazon EC2实例中安装selenium webdriver

Java 在debain 6.0.1 amazon EC2实例中安装selenium webdriver,java,maven,selenium,amazon-ec2,Java,Maven,Selenium,Amazon Ec2,在Debian中安装selenium 我正在关注这个链接 我创建了pom.xml 然后安装jdk和jre 然后安装了ApacheMaven 当我尝试这个命令时 mvn clean install 这给了我一个错误 root@debian:/var/www/sele_webd# mvn clean install Error: JAVA_HOME is not defined correctly. We cannot execute /usr/lib/jvm/java-1.6

在Debian中安装selenium

我正在关注这个链接

我创建了pom.xml 然后安装jdk和jre 然后安装了ApacheMaven

当我尝试这个命令时

   mvn clean install
这给了我一个错误

  root@debian:/var/www/sele_webd# mvn clean install
  Error: JAVA_HOME is not defined correctly.
  We cannot execute /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.i686/bin/java
我怎样才能解决它

或者,在debain 6.0.1中是否有其他易于安装selenium webdriver的教程

在这个链接中重试后,我得到了这个新的错误

                    root@debian:~# mvn install
        [WARNING]
        [WARNING] Some problems were encountered while building the effective settings
        [WARNING] Unable to parse element 'port', must be an integer (position: END_TAG seen ...<port>port_number</port>... @7:31) caused by: java.lang.NumberFormatException: For input string: "port_number" @ /root/.m2/settings.xml, line 7, column 31
        [WARNING]
        [INFO] Scanning for projects...
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD FAILURE
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 0.092 s
        [INFO] Finished at: 2014-03-25T21:11:57-07:00
        [INFO] Final Memory: 2M/15M
        [INFO] ------------------------------------------------------------------------
        [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/root). Please verify you invoked Maven from the correct directory. -> [Help 1]
        [ERROR]
        [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
        [ERROR] Re-run Maven using the -X switch to enable full debug logging.
        [ERROR]
        [ERROR] For more information about the errors and possible solutions, please read the following articles:
        [ERROR] [Help 1] http://cwiki.apache.org/confluen
root@debian:~#mvn安装
[警告]
[警告]构建有效设置时遇到一些问题
[警告]无法分析元素“port”,必须是整数(位置:END_标记已看到…port_编号…@7:31),原因是:java.lang.NumberFormatException:对于输入字符串:“port_编号”@/root/.m2/settings.xml,第7行,第31列
[警告]
[信息]正在扫描项目。。。
[信息]------------------------------------------------------------------------
[信息]生成失败
[信息]------------------------------------------------------------------------
[信息]总时间:0.092秒
[信息]完成时间:2014-03-25T21:11:57-07:00
[信息]最终内存:2M/15M
[信息]------------------------------------------------------------------------
[错误]您指定的目标需要执行一个项目,但此目录(/root)中没有POM。请验证您从正确的目录调用了Maven。->[帮助1]
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完整调试日志记录。
[错误]
[错误]有关错误和可能的解决方案的更多信息,请阅读以下文章:
[错误][帮助1]http://cwiki.apache.org/confluen

检查JAVA\u HOME变量是否配置正确。使用Linux为Java Home设置指南


这里有一个关于Amazon EC2和Java Home的链接。

这可能是环境变量的问题。JAVA_HOME设置为什么。我如何检查它设置为什么?我尝试了echo$JAVA_HOME,但它打印了一条空白行。谢谢您的重播@Lt_Shade。但是我使用的是debain(linux)操作系统,我在其中添加了一个链接,介绍如何使用linux配置它。这个链接对我很有帮助。。谢谢你的帮助,但是我遇到了一些新的错误,你能帮我解释一下错误是什么吗?看起来好像你的端口号没有设置为int,而是一个字符串。您可以尝试在代码中手动设置端口号。