gpt4 book ai didi

Java + Selenium

转载 作者:行者123 更新时间:2023-12-04 19:42:17 24 4
gpt4 key购买 nike

基本配置:

我的 PHP 实例的 Docker 容器,我安装了 Centos 和 java,然后是 Selenium,但是当我尝试启动它时,它给了我一个错误。

[root@6f0958965698 ~]# cat /etc/redhat-release

CentOS Linux release 7.5.1804 (Core)


[root@6f0958965698 ~]# java -jar /opt/selenium-server-standalone.jar

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/openqa/grid/selenium/GridLauncherV3 : Unsupported major.minor version 52.0


[root@6f0958965698 ~]# java -version

java version "1.7.0_191" / OpenJDK Runtime Environment (rhel-2.6.15.4.el7_5-x86_64 u191-b01)/ OpenJDK 64-Bit Server VM (build 24.191-b01, mixed mode)


  • 我首先尝试了 http://selenium-release.storage.googleapis.com/3.9/selenium-server-standalone-3.9.0.jar 版本
  • 然后是:http://selenium-release.storage.googleapis.com/3.2/selenium-server-standalone-3.2.0.jar

  • 同样的错误。

    你有什么建议吗?

    最佳答案

    主线程中的异常 java.lang.UnsupportedClassVersionError被抛出是因为 jar 是用较高版本的 Java 编译并试图用较低版本运行的。

    请引用这个答案:How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version

    前任:
    使用 JDK 1.8 编译
    但是你运行它 JDK 1.7,所以这会引发异常。

    只需将容器中的 java 版本更新为 JDK 1.8 并再次运行。

    关于Java + Selenium ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53173541/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com