I'm trying to set up JDBC to establish a connection to a MySQL database from my Linux machine (specifically KDE side-loaded on a Chromebook). I've seen some posts suggesting one sets the CLASSPATH variable in /etc/bash.bashrc
, some say /etc/profile
. Which of these is the standard?
If I manually set my classpath through a bash command:
export CLASSPATH=/home/username/JDK/mysql-connector-java-8.0.15.jar
It will compile just fine, but running the program yields Error: Could not find or load main class myTest
. Alternatively, if I use the default classpath, compile, and run, I get a ClassNotFoundException
for anything in the code that uses JDBC content.