X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4031052840 for ; Wed, 3 Aug 2005 12:55:25 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 00410-02 for ; Wed, 3 Aug 2005 15:55:19 +0000 (GMT) Received: from srv22.noname-dns.net (srv22.haisoft.net [213.246.63.9]) by svr1.postgresql.org (Postfix) with ESMTP id 1D30052800 for ; Wed, 3 Aug 2005 12:55:18 -0300 (ADT) Received: (qmail 23124 invoked from network); 3 Aug 2005 15:55:16 -0000 Received: from secure.openpricer.com (HELO ?192.168.0.128?) (80.65.224.34) by srv22.noname-dns.net with SMTP; 3 Aug 2005 15:55:16 -0000 Message-ID: <42F0E8E1.9070502@free.fr> Date: Wed, 03 Aug 2005 17:55:13 +0200 From: "Xavier Poinsard" User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050727) X-Accept-Language: fr, en MIME-Version: 1.0 To: abdelkader belkadi Cc: pgsql-jdbc@postgresql.org Subject: Re: pgsql-jdbc and Java References: <20050803153923.33521.qmail@web25705.mail.ukl.yahoo.com> In-Reply-To: <20050803153923.33521.qmail@web25705.mail.ukl.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.073 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200508/23 X-Sequence-Number: 13592 abdelkader belkadi a écrit : > Hello, > I developped my java project with Java NetBeans IDE, > the code connects to a postgreSQL database using the > postgresql-8.1dev-400.jdbc3.jar driver, the project builds and executes > correctly when using the IDE, however when trying to use the DOS command > line as follow: > D:\java -jar projectpath/projectname.jar > the following error is generated: > Class not found ! > java.lang.ClassNotFoundException: org.postgresql.Driver > at java.net.URLClassLoader$1.run(Unknown Source) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(Unknown Source) > at java.lang.ClassLoader.loadClass(Unknown Source) > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) > at java.lang.ClassLoader.loadClass(Unknown Source) > at java.lang.ClassLoader.loadClassInternal(Unknown Source) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Unknown Source) > at logfilerewriter.Main.connectDb(Main.java:235) > at logfilerewriter.Main.main(Main.java:45) > I checked the class path, it is correctly set. > The error disapears if I don't call the method that connects to the > database, which means that their is no CLASSPATH problem. No, it means that there is a class path problem. Could you triple check your CLASSPATH ? What if you add " -cp path_to_postgresqldriver.jar " to your command line ?