aspose file tools*
The moose likes JDBC and the fly likes Resolved - How to get org.postgresql.Driver on the Linux classpath - Resolved Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Resolved - How to get org.postgresql.Driver on the Linux classpath - Resolved" Watch "Resolved - How to get org.postgresql.Driver on the Linux classpath - Resolved" New topic
Author

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

Alvin Watkins
Ranch Hand

Joined: May 25, 2011
Posts: 53
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

Joined: May 25, 2011
Posts: 53
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Resolved - How to get org.postgresql.Driver on the Linux classpath - Resolved