Im trying to run simple selenium script in IntelliJ. This is the code I used
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Demo {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\SP00780555\\Downloads\\chromedriver_win32\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://www.google.com");
}
}
But when I'm trying to run it, it's showing this error:
java: error reading C:\Users\SP00780555\.m2\repository\com\google\errorprone\error_prone_annotations\2.1.3\error_prone_annotations-2.1.3.jar; zip file is empty
CodePudding user response:
This error message...
java: error reading C:\Users\SP00780555\.m2\repository\com\google\errorprone\error_prone_annotations\2.1.3\error_prone_annotations-2.1.3.jar; zip file is empty
...implies that your program is unable to read the local Maven repository i.e. some of the contents from .m2
directory as the repository possibly got corrupted.
Solution
To address this issue you can adopt any of the following two approaches:
- Run:
Maven clean
,Maven install
andMaven test
- Delete the
.m2
directory and Run:Maven clean
,Maven install
andMaven test
(the libraries within the maven repositories will downloaded afresh)
References
You can find a relevant detailed discussion in Getting Selenium-WebDriver Example to work