I have encountered a bizarre exception when setting up Selenium on my local Windows computer. The issue only occurs on the command line, and not when executing the maven command 'mvn clean install' from Intellij IDEA (then it works as expected).
The exception that I get is as follows:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project pfister-webdriver-fmwk: Compilation failure: Compilation failure:
[ERROR] /C:/Users/P010139/IdeaProjects/Project_Name/src/test/java/co.uk/madeupdomain/Locale_Test_Suite.java:[3,17] package org.junit does not exist
To confirm, my path has the maven bin directory on it, and the junit jar on it. Furthermore, Java SDK is also on the path
Typing, mvn -v from the command line returns the following:
Maven home: C:\project_jars\apache-maven-3.6.0\bin\..
Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_181\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
PATH=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_181\bin;C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin;C:\project_jars\selenium-java-2.47.1\selenium-java-2.47.1.jar;C:\project_jars\selenium-server-2.47.1\selenium-2.47.1\selenium-server-2.47.1.jar;C:\project_jars\selenium-server-standalone-2.47.1.jar;C:\project_jars\junit-4.12.jar;C:\project_jars\apache-maven-3.6.0\bin;