3

I made a Java program using IntelliJ IDEA. It's a Maven project due to I had to add the following dependencies into the pom.xml file:

<dependencies>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.48.2</version>
    </dependency>
</dependencies>

I want to run this program in the terminal but I'm a bit lost on how to do this.

I tried navigating through the project folders:

cd Project/target/test-classes/

Then executing this:

java bot.Main

But I get the following error:

Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriver

Seems like it doesn't take into account the pom.xml file and it's dependencies, how can I properly do this?

Project files are the following:

enter image description here

(Inside java folder (green one), there's a package named "bot" and the Main class)

Spectric
  • 27,594
  • 6
  • 14
  • 39
user157629
  • 614
  • 2
  • 14

0 Answers0