After Jar creation, when I call from another project gives me java.lang.NoClassDefFoundError  
Author Message
asfonseca





PostPosted: 2004-6-4 17:51:00 Top

java-programmer, After Jar creation, when I call from another project gives me java.lang.NoClassDefFoundError I'm using WebSphere.
I've create a java project, with one class, that has several methods.
Export it has a jar file. Then in another project add it in libraries has
an external jar file.
When I call methods from that class, it recognizes every method, and
compiles ok. When I try to run it it gives me
"java.lang.NoClassDefFoundError".
Can I create a jar file from a java project?
I'm doing something wrong, it's annoying me, because this jar file is
what's missing me to conclude this project.
Any ideas?
Thanxs
Antonio Fonseca


 
davis





PostPosted: 2004-6-5 0:53:00 Top

java-programmer >> After Jar creation, when I call from another project gives me java.lang.NoClassDefFoundError "asfonseca" <email***@***.com> wrote in message news:<email***@***.com>...
> I'm using WebSphere.
> I've create a java project, with one class, that has several methods.
> Export it has a jar file. Then in another project add it in libraries has
> an external jar file.
> When I call methods from that class, it recognizes every method, and
> compiles ok. When I try to run it it gives me
> "java.lang.NoClassDefFoundError".
> Can I create a jar file from a java project?
> I'm doing something wrong, it's annoying me, because this jar file is
> what's missing me to conclude this project.
> Any ideas?
> Thanxs
> Antonio Fonseca

The java.lang.NoClassDefFoundError is the most irritating error you
can get. I have put together a White Paper on the issues using
packages in jar files. You can view it at
http://www.sqlmagic.com/resources/jarfiles.htm. Hope it helps.
 
Roedy Green





PostPosted: 2004-6-5 2:39:00 Top

java-programmer >> After Jar creation, when I call from another project gives me java.lang.NoClassDefFoundError On Fri, 04 Jun 2004 05:51:28 -0400, "asfonseca"
<email***@***.com> wrote or quoted :

>NoClassDefFoundError

see
http://mindprod.com/jgloss/errormessages.html#NOCLASSDEFFOUNDERROR

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
 
Micha





PostPosted: 2004-6-5 5:39:00 Top

java-programmer >> After Jar creation, when I call from another project gives me java.lang.NoClassDefFoundError
"asfonseca" <email***@***.com> wrote in message
news:email***@***.com...
> I'm using WebSphere.
> I've create a java project, with one class, that has several methods.
> Export it has a jar file. Then in another project add it in libraries has
> an external jar file.
> When I call methods from that class, it recognizes every method, and
> compiles ok. When I try to run it it gives me
> "java.lang.NoClassDefFoundError".
> Can I create a jar file from a java project?
> I'm doing something wrong, it's annoying me, because this jar file is
> what's missing me to conclude this project.
> Any ideas?
> Thanxs
> Antonio Fonseca
>
>
Sounds like you only have set the Java Build Path of your second program. In
WebSphere you also have to set it on the classpath in the Launch
Configuration (if its a java application), on the classpath of the server or
as the Utilies Jar in the Ear.