I'm trying to setup PostgreSQL JDBC Driver with my Java project. I'm not using Maven, don't want to. I haven't been able to figure it out... Please, I need help.
This happens when I run the program (after setting CLASSPATH to the path of my driver, which is in the same folder as MyClass):
java MyClassError: Could not find or load main class MyClass
java MyClassError: Could not find or load main class MyClass
But when I do the following, it executes. Though, the driver isn't found? I specified the CLASSPATH and it's in the same folder as the code.
java java -cp . MyClassException in thread "main" java.lang.ClassNotFoundException: org.postgresql.Driver
java java -cp . MyClassException in thread "main" java.lang.ClassNotFoundException: org.postgresql.Driver
The file structure is Project ---Postgres.jar (driver) ---MyClass.java ---MyClass.class