Reputation: 161
I'm using:
The error message is
The package org.openqa.selenium is accessible from more than one module: client.combined, net.bytebuddy"
Upvotes: 16
Views: 59846
Reputation: 61
The problem is that you are adding .jar
files to your Modulepath instead of Classpath.
Go to
Upvotes: 6
Reputation: 91
this happens when same java package code (package name + class name) is available in more than one jar file; for default modules every jar is exposed as Module. Modules essentially can not have same package name exported. This is more of a code cleanup task.
Upvotes: 0
Reputation: 51
Add all the required jar files inside classpath instead of module path. The same issue was also occurred with me but after adding the jars to classpath it got resolved.
Upvotes: 4
Reputation: 561
This happens when you have added the external jars in the ModulePath.
Solution:
Upvotes: 44
Reputation: 41
Add required JAR in class path instead of module path. Also delete unnecessary JARs which might have reference to the mentioned package.
Upvotes: 2
Reputation: 1
I had the same issue. I used JDK 9 and eclipse oxygen 64-bit version (Selenium 3.9.1). My first thought, it is the JDK 9, but I tested on IntelliJ IDEA JDK 9 and worked without any problem. So I installed the eclipse oxygen 32-bit version with JDK 8 (-no JDK 9 version on 32 bit) and the problem disappeared.
Upvotes: 0
Reputation: 11
I had the same error and removing the reference to one of the jar files solved the issue.
Remove the reference to one of the jar files that you added in java build path.
From the screen shot that you added I see you have reference to both
client-combined-3.6.0-sources.jar
and
client-combined-3.7.0.jar
both the packages have the same classes implemented.
Remove the reference to one and see if that help.
Upvotes: 1
Reputation: 1660
I don't know anything about Selenium, but it looks like you have two modules that contain the exact same package name inside of them:
So when you say e.g. import org.openqa.selenium.WebDriver
Eclipse doesn't know if you want to use that package from client.combined
or from net.bytebuddy
.
You need to either add a prefix in that import statement that will specify whether you're importing package org.openqa.selenium
from client.combined
or from net.bytebuddy
.
You can possibly do this by just doing:
import client.combined.org.openqa.selenium.WebDriver
import client.combined.org.openqa.selenium.firefox.FirefoxDriver
or
import net.bytebuddy.org.openqa.selenium.WebDriver
import net.bytebuddy.org.openqa.selenium.firefox.FirefoxDriver
You can also try removing either of the packages (client.combined
or net.bytebuddy
) from your project
Upvotes: 2