Ha,
Are
you sure that the rt.jar reference in your build path is valid? The error
you mentioned originally means that the classloader doesn't have access to a
class that is in that jar. As far as using your system classpath
(%classpath%), I wouldn't recommend doing it as you will sacrifice portability
to another machine since other machines won't have the same system classpath
(and when you start putting all jars in your system classpath you end up over
time with a huge classpath that becomes very difficult to debug when you do
get classNotFoundExceptions). I try to create my classpaths either in a
batch file or in my ant build script. As far as the . that you are adding
when using command line, I believe
that is done automatically by eclipse when you specify a build directory for the project.
Look
in your properties for the project again, and get the absolute path to rt.jar
from the build path (should be %JAVA_HOME%\jre\lib\rt.jar). Then open that
file using winzip and go to the object class in
the java.lang package. If it's there, then something is really
wrong because eclipse should certainly be able to find it. If you really
want to add your system classpath to the project, you can use the build-path in Eclipse and click on the add variable
button. Hope this helps.
John
I tried all solutions you all suggest but it
still cannot work.
I also have the same problem when compiling at
command line:
"Exception in thread "main"
java.lang.NoClassDefFoundError..."
Then, I type set classpath
%classpath%;.;
(add "."). It works.
But I don't know how to do something like that
on Eclipse. I even set classpath environment variable for my Windows with the
"." but it doesn't
work.
Any other suggestions ?
----- Original Message -----
Sent: Thursday, January 23, 2003 10:10
PM
Subject: Re: [aspectj-users] ask for
compiling examples - sorry if duplicated
I had similar problems just 2 weeks ago. There may be two
things to check or to do: 1. check if your java-classpath is
correct, 2. your AspectJ-project needs absolute paths (NOT relative
paths) in the properties. Hope that may help, Silvia
Ha
Nguyen wrote: > Thanks. I can open the example package now. However, I
have another > problem. I use Eclipse 2.0.2 with aspectj 1.0.6. I
create a new aspectj > project and add 2 files in the introduction
package (Point.java and > ComparablePoint.java) to test my first
aspectj project. I already added > the aspectjrt.jar to the lib and
made configurations as instructed. > Unfortunately, it cannot run.
This is the compiler error: >
------------------------------------------------------------------------ >
> Error occurred during initialization of VM > >
java/lang/NoClassDefFoundError: java/lang/Object > >
------------------------------------------------------------------------ >
> For the reason that I am completely new to aspectj and eclipse,
it's > really difficult for me to find out the problem. Anybody has
experienced > this problem, please help me. > >
MHoang. > > ----- Original Message
----- > *From:* hilsdale@xxxxxxxx <mailto:hilsdale@xxxxxxxx> >
*To:* aspectj-users@xxxxxxxxxxx <mailto:aspectj-users@xxxxxxxxxxx> >
*Sent:* Thursday, January 23, 2003 5:50 PM >
*Subject:* RE: [aspectj-users] ask for compiling examples - sorry
if > duplicated >
> Hello, >
> Two things: >
> 1) If you're using AspectJ 1.1beta to do
your exploration, don't > worry about the
example and docs package, since all the examples
and > docs are included in the one
download. > > 2) If you're using
AspectJ 1.0.6, then I've found that winzip >
(http://winzip.com) handles .tar.gz files
well. > > -erik >
> -----Original
Message----- > From: Ha Nguyen
[mailto:d.h.nguyen@xxxxxxxxxxxxxx] > Sent:
Wednesday, 22 January, 2003 6:21 pm > To: aspectj-users@xxxxxxxxxxx <mailto:aspectj-users@xxxxxxxxxxx> >
Subject: [aspectj-users] ask for compiling examples - sorry
if > duplicated > >
> I am beginning to learn how to work with
AspectJ. I want to try to > compile some
examples as described in the online Documentation but
I > cannot open the example and doc package
(the tar file). Does it work > on WindowsXP or
do I have to work with it on a Unix-base system
? > Please help me out. Thank you. >
> MHoang >
_______________________________________________ >
aspectj-users mailing list > aspectj-users@xxxxxxxxxxx <mailto:aspectj-users@xxxxxxxxxxx> >
http://dev.eclipse.org/mailman/listinfo/aspectj-users >
-- Don't let your fears stand in the way of your
dreams.
Silvia Breu breu@xxxxxxxxxxxxxxxxx +49 851
509-3095 http://www.infosun.fmi.uni-passau.de/st/staff/breu/
_______________________________________________ aspectj-users
mailing list aspectj-users@xxxxxxxxxxx http://dev.eclipse.org/mailman/listinfo/aspectj-users
|