You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by velimzo <ve...@gmail.com> on 2009/12/01 18:51:46 UTC

Hello

I am new in Derby. 

Here is my problem:
I am following "Getting Started With Java DB" instructions.
Problem occures when I try to follow instructions for "Run a JDBC program
using the embedded driver".
I compiled successfully WwdEmbedded.java, not following instructions but
with a command javac *.java
When I try to run WwdEmbedded.java there is an error that looks like this:
-----------------------------------------------------------------------
C:\Documents and Settings\Zoran\Desktop\DERBYTUTOR>java WwdEmbedded
Exception in thread "main" java.lang.NoClassDefFoundError: WwdEmbedded
Caused by: java.lang.ClassNotFoundException: WwdEmbedded
        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)
Could not find the main class: WwdEmbedded.  Program will exit.
-------------------------------------------------------------------------
My version of Java is : Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Version of Derby is : Derby 10.5.3.0
Operating System : Windows XP sp3

I am thankful on every answer...
-- 
View this message in context: http://old.nabble.com/Hello-tp26595406p26595406.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Hello

Posted by velimzo <ve...@gmail.com>.
Thanks people, you saved my life...CLASSPATH was my problem... 



Bryan Pendleton wrote:
> 
>> When I try to run WwdEmbedded.java there is an error that looks like
>> this:
>> -----------------------------------------------------------------------
>> C:\Documents and Settings\Zoran\Desktop\DERBYTUTOR>java WwdEmbedded
>> Exception in thread "main" java.lang.NoClassDefFoundError: WwdEmbedded
> 
> I suspect this is because you didn't set your CLASSPATH environment
> variable
> carefully, to include "." in the classpath. See step (1) of the
> instructions at:
> http://db.apache.org/derby/docs/dev/getstart/twwdactivity3_Setup.html
> and ensure that you have done:
> 
>    set CLASSPATH=%DERBY_HOME%\lib\derby.jar;.
> 
> thanks,
> 
> bryan
> 
> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Hello-tp26595406p26597029.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Hello

Posted by Bryan Pendleton <bp...@amberpoint.com>.
> When I try to run WwdEmbedded.java there is an error that looks like this:
> -----------------------------------------------------------------------
> C:\Documents and Settings\Zoran\Desktop\DERBYTUTOR>java WwdEmbedded
> Exception in thread "main" java.lang.NoClassDefFoundError: WwdEmbedded

I suspect this is because you didn't set your CLASSPATH environment variable
carefully, to include "." in the classpath. See step (1) of the instructions at:
http://db.apache.org/derby/docs/dev/getstart/twwdactivity3_Setup.html
and ensure that you have done:

   set CLASSPATH=%DERBY_HOME%\lib\derby.jar;.

thanks,

bryan




Re: Hello

Posted by Kim Haase <Ca...@Sun.COM>.
This error can happen if you do not have the current directory in your 
classpath. Did you follow all the instructions in the "Setting up your 
environment" section, including "Manually setting the CLASSPATH 
environment variable"?

Kim Haase

On 12/01/09 12:51, velimzo wrote:
> I am new in Derby. 
> 
> Here is my problem:
> I am following "Getting Started With Java DB" instructions.
> Problem occures when I try to follow instructions for "Run a JDBC program
> using the embedded driver".
> I compiled successfully WwdEmbedded.java, not following instructions but
> with a command javac *.java
> When I try to run WwdEmbedded.java there is an error that looks like this:
> -----------------------------------------------------------------------
> C:\Documents and Settings\Zoran\Desktop\DERBYTUTOR>java WwdEmbedded
> Exception in thread "main" java.lang.NoClassDefFoundError: WwdEmbedded
> Caused by: java.lang.ClassNotFoundException: WwdEmbedded
>         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)
> Could not find the main class: WwdEmbedded.  Program will exit.
> -------------------------------------------------------------------------
> My version of Java is : Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
> Version of Derby is : Derby 10.5.3.0
> Operating System : Windows XP sp3
> 
> I am thankful on every answer...