Java – major. Not supported on Mac OS X El capital Minor version

Following the incorrect solution of Java in the major and minor versions of El Capitan, I see several solutions that enable you to disable no rootless, I don't like sound, or just on OS X, El Capitan no longer works

Solution

When trying to run webdriver manager startup on El Capitan, you may receive an error:

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

The recommended patch for this online is to change the symbolic link of Mac OS X to Java. You can run echo $Java in the terminal_ Home to find

This is pointing to an incorrect folder, and the error is because the application is compiled with a higher version of JRE rather than the machine running in the terminal

You should go to Oracle and download the latest JRE version( http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html )

After installation, Java 8 will be installed on your machine, but the terminal will not be updated correctly If you run Java - version in the terminal, you will see java version "1.6", which you hope can be called Java version "1.8" The previous method was to manually change the symbolic link, but because of El Capitan, apple made some folders unchangeable even for administrator users using a rootless installation This includes the / usr folder

There are two ways to solve this problem. The first is dangerous, and others seem to recommend Second, it's safer. What do I put here

If you go to system preferences – > java – > java – > View... – > system and copy the path field

It will look similar to the following:

/ Library / Internet Plug-ins / JavaAppletPlugin. plugin / Contents / Home / bin / java

We want most of this path, except the last / bin / Java

So your path should be copied as:

/ Library / Internet Plug-Ins / JavaAppletPlugin. plugin / Contents / Home

Run the following command in the terminal to replace [path] with the path you obtained from above

export JAVA_ HOME =“[PATH]”

And run in the terminal

Then run Java - version. Now it should be said that the Java version is "1.8"

Now, the webdriver manager should start successfully

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>