I have the variables included in eclipse and the dependencies in the
pom. However I'm still having the same trouble. 

By setting the classpath variable in the command prompt do mean adding
the required jars to the CLASSPATH environment variable?
If so is there any way that maven can include the required jars in a lib
folder when it packages the project as a jar? Or even just the specific
classes it needs from the jars? 



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Lee Meador
Sent: 24 February 2006 16:16
To: Maven Users List
Subject: Re: [m2] Failure to recognise a jar

You can right click on the project in the tree of the package explorer
in
eclipse and choose 'properties'. Then select the 'build classpath' in
the
left part of the popup. Then click the 'libraries' tab. This shows all
the
things that your project depends on from eclipse's point of view. The
little
icon indicates whether eclipse can find it or not.

Look around in there to see if your dependency jar is present. If not,
you
can add it it by adding from a variable. Use the variable M2_REPO--which
should resolve to the folder in which your maven repository lies. Then
'extend' from there to find the jar in your repository.

These eclipse classpath entries are used when compiling, testing and
running
from inside eclipse.

Similarly, the <dependency> tags in your pom.xml will determine how
maven
sets up the classpath when compiling your java files.

Finally, when you run the program from the command line, you will need
to
set the classpath, either with a "set classpath=..." or on the command
line
as "java -classpath ...". (If you are running inside a web or
application
server, there are more complicated rules for setting up the classpath.)

Let us know how your classpath is set in these three environments and
maybe
we can provide some help. The error you showed seems to indicate
something
is missing from the classpath at runtime.

-- Lee

On 2/24/06, Gerard Garrigan <[EMAIL PROTECTED]>
wrote:
>
> Also when I run mvn package in the command prompt. The only thing the
> created jar contains is the class from the project itself and nothing
to
> do with the dependant jar files.
>
> Running this jar gives this error:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> com/precisionsoftware/utils/AppProperties
>         at
>
com.precisionsoftware.customizeskin.CustomizeSkin.setProperties(Customiz
> eSkin.java:209)
>         at
>
com.precisionsoftware.customizeskin.CustomizeSkin.run(CustomizeSkin.java
> :743)
>         at
>
com.precisionsoftware.customizeskin.CustomizeSkin.main(CustomizeSkin.jav
> a:758)
>
>
>
> -----Original Message-----
> From: Gerard Garrigan [mailto:[EMAIL PROTECTED]
> Sent: 24 February 2006 15:29
> To: Maven Users List
> Subject: RE: [m2] Failure to recognise a jar
>
> Hello Thorsten,
>
> For the line,
>
> import com.precisionsoftware.trax.common.tools.AppDetails;
>
> it will say that the import cannot be resolved.
>
> Thanks,
>
> Ger
>
> -----Original Message-----
> From: Thorsten Heit [mailto:[EMAIL PROTECTED]
> Sent: 24 February 2006 15:20
> To: Maven Users List
> Subject: Re: [m2] Failure to recognise a jar
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> > my libraries in eclipse. However when I try to import a class
> contained
> > in the jar eclipse throws an error.
>
> What kind of error?
>
>
> Regards
>
> Thorsten
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.1 (MingW32)
>
> iD8DBQFD/yQaQvObkgCcDe0RAtnYAJ9qgXLvReOXMx1+POZwGRxK3KH76QCfYbm7
> ixauH7pzO1b8+6djEAiLoSo=
> =ogKz
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
-- Lee Meador
Sent from gmail. My real email address is [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to