Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » The package org.openqa.selenium is accessible from more than one module: net.bytebuddy, phantomjsdri(Error)
The package org.openqa.selenium is accessible from more than one module: net.bytebuddy, phantomjsdri [message #1779793] Fri, 12 January 2018 17:02 Go to next message
Farrokh Yousefi is currently offline Farrokh YousefiFriend
Messages: 1
Registered: January 2018
Junior Member
Dear all,

I wrote a java program for getting source of webpage using Selenium Webdriver and PhantomJSDriver. For this purpose, I have added Selenium jar files and PhantomJSDriver jar file to eclipse library. Now, the program goes to error for "import org.openqa.selenium.WebDriver;". The error is : The package org.openqa.selenium is accessible from more than one module: net.bytebuddy, phantomjsdriver. Please see attached screenshot image. I searched through net, but could not found a solution. Please kindly help me. Thanks a lot.

package get;

import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;


import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriverService;
import org.openqa.selenium.remote.DesiredCapabilities;


public class Get {

    public static void main(String[] args) {
    	Set<String> myset = new HashSet<String>();
    	int number = 122;
    	while(number <= 123) {
    	try {
    	PrintWriter writer = new PrintWriter("C:\\Users\\farrokh\\Desktop\\world-database\\re\\"+ number +".html", "UTF-8");
    	
		   	
    	DesiredCapabilities DesireCaps = new DesiredCapabilities();
        DesireCaps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "D:\\phantomjs-2.1.1-windows\\phantomjs-2.1.1-windows\\bin\\phantomjs.exe");
        WebDriver driver=new PhantomJSDriver(DesireCaps);
                
        String baseUrl = "http://google.com";
        driver.get(baseUrl);
         
        String html = driver.getPageSource();
               
        writer.println(html);
        System.out.println(number);

        driver.close();
        
    	} catch (Exception e) {};
       
    }
    }

}
Re: The package org.openqa.selenium is accessible from more than one module: net.bytebuddy, phantomj [message #1779942 is a reply to message #1779793] Mon, 15 January 2018 23:31 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1636
Registered: July 2009
Senior Member
In Java 9, it is illegal for any module to read the same package from different modules. Apparently this is what your code is trying to do.
Please look into the referenced libraries to check that both declare the package org.openqa.selenium.
Previous Topic:Updating Maven Dependencies would not terminate
Next Topic:Conditional Breakpoints in Oxygen.1A
Goto Forum:
  


Current Time: Wed Oct 17 08:33:47 GMT 2018

Powered by FUDForum. Page generated in 0.02268 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top