Problems with protractor + Java. (AngularJS)

I wanted to install a protractor to work with our AngularJS project. Everything went fine until 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 

Then I realized that I was using the wrong version of java (1.6.0_65). So, Ive got the latest version (1.8) and basically the problem was that on the terminal this would show me the old version. but on my actual computer I would show the latest version.

However, I tried to remove java by running this command:

 sudo rm /usr/bin/java 

and got it no matter what i do.

 sudo rm: /usr/bin/java: Operation not permitted 

Has anyone experienced the same thing?

(Using OS X 'El Capitan' as my operating system)

+5
source share
1 answer

You are using mac, and the default Java version for mac osx is still Java 6 by default (Apple stopped releasing its own version of Java several years ago). So, you need to manually install a newer version of Java from Oracle to get the latest version.

Download the latest version of Java here. Then run the downloaded dmg file and follow the instructions to complete the installation.

After installing Java 8, just run webdriver-manager start and you should be good to go.

+2
source

Source: https://habr.com/ru/post/1235206/


All Articles