-1

So I am trying to connect to my server, I had it working before but now I moved to a different machine it's not working as you can see below.

enter image description here

I have added the MySQL driver into my path and I'm not sure what the problem could be.

Any ideas?

Thanks.

Definity
  • 691
  • 2
  • 11
  • 31
  • Check the classpath in code or in debugger. You may not have configured it correctly – Miserable Variable Jan 18 '16 at 21:24
  • You should set your classpath by adding the Classes folder. check this post : http://stackoverflow.com/questions/6104551/java-setting-classpath – jmj Jan 18 '16 at 21:40

2 Answers2

2

You indeed have defined that MySQL connector is a library for your project, but you also need to add it as a module dependency on the Modules tab in Project Structure.

sfThomas
  • 1,895
  • 2
  • 18
  • 26
0

If you haven't dependency management such as maven (gradle, etc), create lib folder in project root folder. Move jar to lib folder and right click on it and select "Add as library". This should help you.

eg04lt3r
  • 2,467
  • 14
  • 19
  • This should compile without a 3rd party build tool, even though it is always a good idea to be able to build without the IDE. – sfThomas Jan 18 '16 at 21:33