Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Could not find or load main class ..selenium-server-standalone-3.7.1.jar #5488

Closed
flik opened this issue Feb 13, 2018 · 8 comments
Closed

Comments

@flik
Copy link

flik commented Feb 13, 2018

Meta -

OS:
Ubuntu 14
Selenium Version:
selenium-server-standalone-3.7.1.jar
Browser:
Firefox

Since Firefox version 48, Mozilla requires all add-ons to be signed. Until
recently, Firefox support in Selenium was exclusively provided by an add-on.
As this add-on is not currently signed, this solution does not work with the
latest Firefox releases. As an alternative, Mozilla are working on a WebDriver
specification compliant implementation named GeckoDriver. Please note that the specification is not complete, and that Selenium itself does not comply with
the specification at this time. This means that features previously available
through Selenium will not be available using GeckoDriver.

Any issue logged here for Firefox 48 or later will be closed as a duplicate of
#2559. Our recommendation is to switch to GeckoDriver, or to continue testing
on Firefox 45 until GeckoDriver is a viable option for you. If you are
interested in helping us to sign the add-on to restore support for later
Firefox versions, please see the following comment for what's needed:
#2942 (comment)

If the issue is with Google Chrome consider logging an issue with chromedriver instead:
https://sites.google.com/a/chromium.org/chromedriver/help

If the issue is with Microsoft Edge consider logging an issue with Microsoft instead:
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/

If the issue is with Firefox GeckoDriver (aka Marionette) consider logging an issue with Mozilla:
https://bugzilla.mozilla.org/buglist.cgi?product=Testing&component=Marionette

If the issue is with Safari, only Safari 10+ is supported. Please log any Safari issue with Apple:
https://bugreport.apple.com/

If the issue is with PhantomJS consider logging an issue with Ghostdriver:
https://github.com/detro/ghostdriver

-->

Browser Version:

Expected Behavior - server should start

Actual Behavior - error is coming

Steps to reproduce -

sudo java ./selenium-server-standalone-3.7.1.jar 
[sudo] password for adminx: 
Error: Could not find or load main class ..selenium-server-standalone-3.7.1.jar

sudo java -jar selenium-server-standalone-3.7.1.jar 
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/openqa/grid/selenium/GridLauncherV3 : Unsupported major.minor version 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:442)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:64)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:354)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:312)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
@lmtierney
Copy link
Member

You need to launch it with -jar.

    java -jar ./selenium-server-standalone-3.7.1.jar

@lmtierney lmtierney reopened this Feb 13, 2018
@lmtierney
Copy link
Member

Whoops, didn't see you did the second time.

@lmtierney
Copy link
Member

Java 8 is required, please see https://github.com/seleniumhq/selenium#requirements

@flik
Copy link
Author

flik commented Feb 13, 2018

thanks. :)

@AbhreshSugandhi
Copy link

Hi,
I have similar issue but in my case here is the response from the cmd:
Error: Could not find or load main class .chrome.driver=

because of this I am unable to execute!

Commands used:
java -Dwebdriver.chrome.driver= E:\Abhresh\Installation stuff\Exe Files\chromedriver.exe -jar grid.jar -role node -hub http://192.168.0.11:4444/grid/register

Unable to execute the script on the browser

package GridTest;

import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

import java.net.MalformedURLException;
import java.net.URL;

import org.junit.Assert;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

public class TestGrid {
	static WebDriver driver;
	static String nodeUrl;

	@BeforeTest
	public void setup() throws MalformedURLException {
		System.setProperty("webdriver.chrome.driver", "E:\\Abhresh\\Installation stuff\\Exe Files\\chromedriver.exe");
		nodeUrl = "http://192.168.1.201:5555/wd/hub";
		DesiredCapabilities capabilities = DesiredCapabilities.chrome();
		capabilities.setBrowserName("chrome");
		capabilities.setPlatform(Platform.WINDOWS);
		driver = new RemoteWebDriver(new URL(nodeUrl), capabilities);
	}

	@Test
	public void simpleTest() {
		driver.get("https://www.edureka.co/");
		Assert.assertEquals("Instructor Led Online Courses with 24x7 On-Demand Support | Edureka", driver.getTitle());
	}

	@AfterTest
	public void afterTest() {
		driver.quit();
	}
}

@mdzakirh
Copy link

mdzakirh commented Oct 9, 2018

You have to use "" for the file path like "E:\Abhresh\Installation stuff\Exe Files\chromedriver.exe"

@AbhreshSugandhi
Copy link

thanks :-) will try

@lock
Copy link

lock bot commented Sep 12, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants