Protractor + Java issues. (AngularJS)(量角器 + Java 问题.(AngularJS))
问题描述
我想安装量角器以使用我们的 AngularJS 项目.在我运行命令之前一切正常:
I wanted to install protractor in order to work with our AngularJS project. Everything went OK till I ran the command:
webdriver-manager start
...我遇到了一些错误:
...and I got some errors:
seleniumProcess.pid: 5421
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/openqa/grid/selenium/GridLauncher : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Selenium Standalone has exited with code 1
然后我明白我使用了错误的java版本(1.6.0_65).所以我得到了最新的(1.8)基本上问题是在终端上它会显示旧版本.但在我的实际计算机上会显示最新的.
Then I understood that I was using the wrong version of java (1.6.0_65). So Ive got the latest one (1.8) and basically the problem was that on terminal it would show me the old version. but on my actual computer would show me the latest.
但是我尝试通过运行以下命令来卸载 java:
However I tried uninstalling java by running this command:
sudo rm /usr/bin/java
无论我做什么,都会得到这个.
and been getting this, no matter what I do.
sudo rm: /usr/bin/java: Operation not permitted
有没有人经历过同样的事情?
(使用 OS X 'El Capitan' 作为我的操作系统)
(Using OS X 'El Capitan' as my operating system)
推荐答案
您使用的是 mac 并且 mac osx 上的默认 Java 版本仍然是 Java 6(Apple 几年前停止生产自己的 Java 版本).因此,您需要从 Oracle 手动安装更新版本的 Java 以获得最新版本.
You are using a mac and the default version of Java on mac osx is still Java 6 (Apple stopped producing their own version of Java a number of years ago). So, you need to manually install a more recent version of Java from Oracle to get the latest version.
在这里下载最新版本的Java.然后,运行下载的dmg 文件并按照说明完成安装.
Download the latest version of Java here. Then, run the downloaded dmg file and follow the instructions to complete the installation.
安装 Java 8 后,只需重新运行 webdriver-manager start 即可.
After installing Java 8, simply re-run webdriver-manager start and you should be good to go.
这篇关于量角器 + Java 问题.(AngularJS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:量角器 + Java 问题.(AngularJS)
基础教程推荐
- JPA惰性列表上的流 2022-01-01
- 在java中使用xpath和selenium解析HTML表格数据 2022-01-01
- doFilter()是在servlet的工作完成之前还是之后执行的? 2022-01-01
- 如何在相机中应用自定义滤镜 [Surfaceview 预览]. 2022-01-01
- Maven:无效的目标版本:10 2022-01-01
- 控制台应用程序中的 Java 键盘输入解析 2022-01-01
- 在springboot中如何给mybatis加拦截器 2023-04-29
- 将 Windows 证书导入 Java 2022-01-01
- Java ECDSAwithSHA256 签名长度不一致 2022-01-01
- 将 double 转换为 Int,向下舍入 2022-01-01
