Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Resolved - How to get org.postgresql.Driver on the Linux classpath - Resolved

 
Alvin Watkins
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to start my server with:

java -cp /usr/local/javaservers/myserver-1.0.jar...

When I do, the server comes up and tries to access the PostgreSQL db I have installed. Java then throws an error "java.lang.ClassNotFoundException: org.postgresql.Driver

I tried adding the postgresql-9.0-801.jdbc4-1.0.jar to the classpath by putting a ":" between the above line and the path to that jar. That didn't work either. I also tried the -Ddrivers flag and pointed to the driver jar to no avail. This is code that worked on Windows and is now being migrated to Linux.

How do I get the PostgreSQL driver on the Linux classpath so this problem goes away? Thanks for your help.

Best,
Al
 
Alvin Watkins
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It appears that the problem was not that the classpath was not finding org.postgresql.Driver. The real problem was that the name of the database changed. Once I updated the connection to point to the right DB name, everything works.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic