pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
java.lang.NoClassDefFoundError
5+ messages / 3 participants
[nested] [flat]

* java.lang.NoClassDefFoundError
@ 2005-01-18 13:37 Becerra Lagos Ana Lilian <exabecerra@nt.entel.cl>
  2005-01-18 15:25 ` Re: java.lang.NoClassDefFoundError William Lai <wlai2768@gmail.com>
  2005-01-18 15:45 ` Re: java.lang.NoClassDefFoundError Nico <nicohmail-postgresql@yahoo.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Becerra Lagos Ana Lilian @ 2005-01-18 13:37 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,

 

Could you help me in my program JAVA with jdbc Postgre

I have my simple code 

 

import java.sql.DriverManager;

import java.sql.Connection;

import java.sql.SQLException;

 

public class Example2 {

  public static void main(String[] argv) {

  System.out.println("Checking if Driver is registered with
DriverManager.");

  

  try {

    Class.forName("org.postgresql.Driver");

  } catch (ClassNotFoundException cnfe) {

    System.out.println("Couldn't find the driver!");

    System.out.println("Let's print a stack trace, and exit.");

    cnfe.printStackTrace();

    System.exit(1);

  }

  }

 }

 

Then I execute :

javac Example2.java

 

Then I execute

            java Example2

 

but I get

Exception in thread "main" java.lang.NoClassDefFoundError: Example

 

Wich is my error ?

I copied pg73jdbc3.jar  in my path 

C:\j2sdk1.4.1_07\lib\

Its have org.postgresql.Driver

 

Thanks advanted

ana
Este correo es dirigido solo a las personas que aparecen como destinatarios 
y puede contener informacion confidencial o privilegiada.
Si usted recibio este correo por error, por favor notificar inmediatamente 
al emisor y elimine el correo original. Cualquier otro uso de este correo 
esta prohibido. 

****************************************************************************************************** 

This message is for the designated recipient only and may contain privileged or 
confidential information. If you have received it in error, please notify the sender 
immediately and delete the original. Any other use of the email is prohibited.

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: java.lang.NoClassDefFoundError
  2005-01-18 13:37 java.lang.NoClassDefFoundError Becerra Lagos Ana Lilian <exabecerra@nt.entel.cl>
@ 2005-01-18 15:25 ` William Lai <wlai2768@gmail.com>
  1 sibling, 0 replies; 5+ messages in thread

From: William Lai @ 2005-01-18 15:25 UTC (permalink / raw)
  To: Becerra Lagos Ana Lilian <exabecerra@nt.entel.cl>; +Cc: pgsql-jdbc

Hi,

Did you try,

java -classpath c:\path\to\pg73jdbc3.jar;. Example2

Have a nice day,
William

Becerra Lagos Ana Lilian wrote:

> Hi,
>
>  
>
> Could you help me in my program JAVA with jdbc Postgre
>
> I have my simple code
>
>  
>
> import java.sql.DriverManager;
>
> import java.sql.Connection;
>
> import java.sql.SQLException;
>
>  
>
> public class Example2 {
>
>   public static void main(String[] argv) {
>
>   System.out.println("Checking if Driver is registered with 
> DriverManager.");
>
>  
>
>   try {
>
>     Class.forName("org.postgresql.Driver");
>
>   } catch (ClassNotFoundException cnfe) {
>
>     System.out.println("Couldn't find the driver!");
>
>     System.out.println("Let's print a stack trace, and exit.");
>
>     cnfe.printStackTrace();
>
>     System.exit(1);
>
>   }
>
>   }
>
>  }
>
>  
>
> Then I execute :
>
> javac Example2.java
>
>  
>
> Then I execute
>
>             java Example2
>
>  
>
> but I get
>
> Exception in thread "main" java.lang.NoClassDefFoundError: Example
>
>  
>
> Wich is my error ?
>
> I copied pg73jdbc3.jar  in my path
>
> C:\j2sdk1.4.1_07\lib\
>
> Its have org.postgresql.Driver
>
>  
>
> Thanks advanted
>
> ana
>
> Este correo es dirigido solo a las personas que aparecen como 
> destinatarios
> y puede contener información confidencial o privilegiada.
> Si usted recibió este correo por error, por favor notificar 
> inmediatamente
> al emisor y elimine el correo original. Cualquier otro uso de este correo
> esta prohibido.
>
> ****************************************************************************************************** 
>
>
> This message is for the designated recipient only and may contain 
> privileged or
> confidential information. If you have received it in error, please 
> notify the sender
> immediately and delete the original. Any other use of the email is 
> prohibited.




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: java.lang.NoClassDefFoundError
  2005-01-18 13:37 java.lang.NoClassDefFoundError Becerra Lagos Ana Lilian <exabecerra@nt.entel.cl>
@ 2005-01-18 15:45 ` Nico <nicohmail-postgresql@yahoo.com>
  1 sibling, 0 replies; 5+ messages in thread

From: Nico @ 2005-01-18 15:45 UTC (permalink / raw)
  To: pgsql-jdbc

It didn't work for me either. When I put the jar file in my classes directory, it did work.
  ""Becerra Lagos Ana Lilian"" <exabecerra@nt.entel.cl> schreef in bericht news:3A568BC085A5794983C7118F1A27CDEC2C7C40@epmarexc03.Entelpcs.Entelcorp.com...
  Hi,



  Could you help me in my program JAVA with jdbc Postgre

  I have my simple code 



  import java.sql.DriverManager;

  import java.sql.Connection;

  import java.sql.SQLException;



  public class Example2 {

    public static void main(String[] argv) {

    System.out.println("Checking if Driver is registered with DriverManager.");

    

    try {

      Class.forName("org.postgresql.Driver");

    } catch (ClassNotFoundException cnfe) {

      System.out.println("Couldn't find the driver!");

      System.out.println("Let's print a stack trace, and exit.");

      cnfe.printStackTrace();

      System.exit(1);

    }

    }

   }



  Then I execute :

  javac Example2.java



  Then I execute

              java Example2



  but I get

  Exception in thread "main" java.lang.NoClassDefFoundError: Example



  Wich is my error ?

  I copied pg73jdbc3.jar  in my path 

  C:\j2sdk1.4.1_07\lib\

  Its have org.postgresql.Driver



  Thanks advanted

  ana

  Este correo es dirigido solo a las personas que aparecen como destinatarios 
  y puede contener información confidencial o privilegiada.
  Si usted recibió este correo por error, por favor notificar inmediatamente 
  al emisor y elimine el correo original. Cualquier otro uso de este correo 
  esta prohibido. 

  ****************************************************************************************************** 

  This message is for the designated recipient only and may contain privileged or 
  confidential information. If you have received it in error, please notify the sender 
  immediately and delete the original. Any other use of the email is prohibited. 

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: java.lang.NoClassDefFoundError
@ 2005-01-18 15:36 Becerra Lagos Ana Lilian <exabecerra@nt.entel.cl>
  2005-01-18 15:58 ` Re: java.lang.NoClassDefFoundError William Lai <wlai2768@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Becerra Lagos Ana Lilian @ 2005-01-18 15:36 UTC (permalink / raw)
  To: William Lai <wlai2768@gmail.com>; +Cc: pgsql-jdbc

But now
I get

C:\j2sdk1.4.1_07\bin>java -classpath c:\j2sdk1.4.1_07\lib\pg73jdbc.jar;. Example
2
Checking if Driver is registered with DriverManager.
Couldn't find the driver!
Let's print a stack trace, and exit.
java.lang.ClassNotFoundException: org.postgresql.Driver
        at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:272)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:140)
        at Example2.main(Example2.java:10)

:(



-----Mensaje original-----
De: William Lai [mailto:wlai2768@gmail.com] 
Enviado el: Martes, 18 de Enero de 2005 12:25
Para: Becerra Lagos Ana Lilian
CC: pgsql-jdbc@postgresql.org
Asunto: Re: [JDBC] java.lang.NoClassDefFoundError

Hi,

Did you try,

java -classpath c:\path\to\pg73jdbc3.jar;. Example2

Have a nice day,
William

Becerra Lagos Ana Lilian wrote:

> Hi,
>
>  
>
> Could you help me in my program JAVA with jdbc Postgre
>
> I have my simple code
>
>  
>
> import java.sql.DriverManager;
>
> import java.sql.Connection;
>
> import java.sql.SQLException;
>
>  
>
> public class Example2 {
>
>   public static void main(String[] argv) {
>
>   System.out.println("Checking if Driver is registered with 
> DriverManager.");
>
>  
>
>   try {
>
>     Class.forName("org.postgresql.Driver");
>
>   } catch (ClassNotFoundException cnfe) {
>
>     System.out.println("Couldn't find the driver!");
>
>     System.out.println("Let's print a stack trace, and exit.");
>
>     cnfe.printStackTrace();
>
>     System.exit(1);
>
>   }
>
>   }
>
>  }
>
>  
>
> Then I execute :
>
> javac Example2.java
>
>  
>
> Then I execute
>
>             java Example2
>
>  
>
> but I get
>
> Exception in thread "main" java.lang.NoClassDefFoundError: Example
>
>  
>
> Wich is my error ?
>
> I copied pg73jdbc3.jar  in my path
>
> C:\j2sdk1.4.1_07\lib\
>
> Its have org.postgresql.Driver
>
>  
>
> Thanks advanted
>
> ana
>
> Este correo es dirigido solo a las personas que aparecen como 
> destinatarios
> y puede contener información confidencial o privilegiada.
> Si usted recibió este correo por error, por favor notificar 
> inmediatamente
> al emisor y elimine el correo original. Cualquier otro uso de este correo
> esta prohibido.
>
> ****************************************************************************************************** 
>
>
> This message is for the designated recipient only and may contain 
> privileged or
> confidential information. If you have received it in error, please 
> notify the sender
> immediately and delete the original. Any other use of the email is 
> prohibited.
Este correo es dirigido solo a las personas que aparecen como destinatarios 
y puede contener información confidencial o privilegiada.
Si usted recibió este correo por error, por favor notificar inmediatamente 
al emisor y elimine el correo original. Cualquier otro uso de este correo 
esta prohibido. 

****************************************************************************************************** 

This message is for the designated recipient only and may contain privileged or 
confidential information. If you have received it in error, please notify the sender 
immediately and delete the original. Any other use of the email is prohibited.



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: java.lang.NoClassDefFoundError
  2005-01-18 15:36 Re: java.lang.NoClassDefFoundError Becerra Lagos Ana Lilian <exabecerra@nt.entel.cl>
@ 2005-01-18 15:58 ` William Lai <wlai2768@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: William Lai @ 2005-01-18 15:58 UTC (permalink / raw)
  To: Becerra Lagos Ana Lilian <exabecerra@nt.entel.cl>; +Cc: pgsql-jdbc

Please double-check the your jar filename, is pg73jdbc.jar or pg73jdbc3.jar?

Becerra Lagos Ana Lilian wrote:

>But now
>I get
>
>C:\j2sdk1.4.1_07\bin>java -classpath c:\j2sdk1.4.1_07\lib\pg73jdbc.jar;. Example
>2
>Checking if Driver is registered with DriverManager.
>Couldn't find the driver!
>Let's print a stack trace, and exit.
>java.lang.ClassNotFoundException: org.postgresql.Driver
>        at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
>        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:272)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
>        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
>        at java.lang.Class.forName0(Native Method)
>        at java.lang.Class.forName(Class.java:140)
>        at Example2.main(Example2.java:10)
>
>:(
>
>
>
>-----Mensaje original-----
>De: William Lai [mailto:wlai2768@gmail.com] 
>Enviado el: Martes, 18 de Enero de 2005 12:25
>Para: Becerra Lagos Ana Lilian
>CC: pgsql-jdbc@postgresql.org
>Asunto: Re: [JDBC] java.lang.NoClassDefFoundError
>
>Hi,
>
>Did you try,
>
>java -classpath c:\path\to\pg73jdbc3.jar;. Example2
>
>Have a nice day,
>William
>
>Becerra Lagos Ana Lilian wrote:
>
>  
>
>>Hi,
>>
>> 
>>
>>Could you help me in my program JAVA with jdbc Postgre
>>
>>I have my simple code
>>
>> 
>>
>>import java.sql.DriverManager;
>>
>>import java.sql.Connection;
>>
>>import java.sql.SQLException;
>>
>> 
>>
>>public class Example2 {
>>
>>  public static void main(String[] argv) {
>>
>>  System.out.println("Checking if Driver is registered with 
>>DriverManager.");
>>
>> 
>>
>>  try {
>>
>>    Class.forName("org.postgresql.Driver");
>>
>>  } catch (ClassNotFoundException cnfe) {
>>
>>    System.out.println("Couldn't find the driver!");
>>
>>    System.out.println("Let's print a stack trace, and exit.");
>>
>>    cnfe.printStackTrace();
>>
>>    System.exit(1);
>>
>>  }
>>
>>  }
>>
>> }
>>
>> 
>>
>>Then I execute :
>>
>>javac Example2.java
>>
>> 
>>
>>Then I execute
>>
>>            java Example2
>>
>> 
>>
>>but I get
>>
>>Exception in thread "main" java.lang.NoClassDefFoundError: Example
>>
>> 
>>
>>Wich is my error ?
>>
>>I copied pg73jdbc3.jar  in my path
>>
>>C:\j2sdk1.4.1_07\lib\
>>
>>Its have org.postgresql.Driver
>>
>> 
>>
>>Thanks advanted
>>
>>ana
>>
>>Este correo es dirigido solo a las personas que aparecen como 
>>destinatarios
>>y puede contener informaci�n confidencial o privilegiada.
>>Si usted recibi� este correo por error, por favor notificar 
>>inmediatamente
>>al emisor y elimine el correo original. Cualquier otro uso de este correo
>>esta prohibido.
>>
>>****************************************************************************************************** 
>>
>>
>>This message is for the designated recipient only and may contain 
>>privileged or
>>confidential information. If you have received it in error, please 
>>notify the sender
>>immediately and delete the original. Any other use of the email is 
>>prohibited.
>>    
>>
>Este correo es dirigido solo a las personas que aparecen como destinatarios 
>y puede contener informaci�n confidencial o privilegiada.
>Si usted recibi� este correo por error, por favor notificar inmediatamente 
>al emisor y elimine el correo original. Cualquier otro uso de este correo 
>esta prohibido. 
>
>****************************************************************************************************** 
>
>This message is for the designated recipient only and may contain privileged or 
>confidential information. If you have received it in error, please notify the sender 
>immediately and delete the original. Any other use of the email is prohibited.
>
>  
>



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2005-01-18 15:58 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-18 13:37 java.lang.NoClassDefFoundError Becerra Lagos Ana Lilian <exabecerra@nt.entel.cl>
2005-01-18 15:25 ` William Lai <wlai2768@gmail.com>
2005-01-18 15:45 ` Nico <nicohmail-postgresql@yahoo.com>
2005-01-18 15:36 Re: java.lang.NoClassDefFoundError Becerra Lagos Ana Lilian <exabecerra@nt.entel.cl>
2005-01-18 15:58 ` William Lai <wlai2768@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox