I was following this tutorial: https://www.youtube.com/watch?v=UlY_6N98WWs&list=PLIBI8eaaUGfSupVFlMBefGodvWQ9ydq51&index=4 And got this error:
$ java -classpath selenium-server-standalone-3.11.0.jar HelloWorld 
Error: Could not find or load main class HelloWorld
But if I run $ java HelloWorld, it works just fine, and says
Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/selenium/firefox/FirefoxDriver at 
HelloWorld.main(HelloWorld.java:13) Caused by: 
java.lang.ClassNotFoundException: 
org.openqa.selenium.firefox.FirefoxDriver at 
java.net.URLClassLoader.findClass(URLClassLoader.java:381) at 
java.lang.ClassLoader.loadClass(ClassLoader.java:424) at 
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.j
I’m on Mac terminal, and I tried with CLASSPATHs of . and blank. My $PATH variable is /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin and seems to be fine.
I tried looking at these pages for the solution: https://docs.oracle.com/javase/tutorial/essential/environment/paths.html https://docs.oracle.com/javase/7/docs/technotes/tools/windows/classpath.html What does "Could not find or load main class" mean?
And it seems like my class path is working fine, but something else is glitchy?
HelloWorld.java
/**
 * Import FirefoxDriver and By from selenium jar
 */
import org.openqa.selenium.By;
import org.openqa.selenium.firefox.FirefoxDriver;
public class HelloWorld{
    public static void main(String args[]) throws Exception{
        // Create a Firefox browser instance
        FirefoxDriver driver = new FirefoxDriver();
        // Navigate to google home page
        driver.get("https://www.google.co.in/");
        // Type hello world in the search field
        driver.findElement(By.name("q")).sendKeys("Hello World");
        // Wait for 10 seconds
        Thread.sleep(10*1000);
        // Close the browser instance
        driver.quit();
    }
}
Selenium Standalone Server version 3.11.0 downloaded from: https://www.seleniumhq.org/download/
I'm running on Mac OS 10.13.3.
