Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] Difference between Eclipse and Command Line

Hi,

I'm new to AOP and AspectJ.
I wrote an simple program which calls a function and prints a line
I also wrote an Aspect to print a line when entering and when exiting a
function. I have been able to run this without problems in Eclipse.
But when I try this, I get an error:

$ java atest.Mainclass
Exception in thread "main" java.lang.NoClassDefFoundError:
org/aspectj/lang/NoAspectBoundException
	at atest.Mainclass.main(Mainclass.java:9)
Caused by: java.lang.ClassNotFoundException:
org.aspectj.lang.NoAspectBoundException
	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
	... 1 more

When including the aspectjrt jar file, I get this:
$ java -classpath "aspectjrt.jar" atest.Mainclass
Exception in thread "main" java.lang.NoClassDefFoundError:
atest/Mainclass
Caused by: java.lang.ClassNotFoundException: atest.Mainclass
	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: atest.Mainclass.  Program will exit.


What am I doing wrong?
I'm using Ubuntu 9.04 and java version "1.6.0_13"
Thanks in advance for your help.

Kind regards,
Pieter

SunSPOT profiling
http://patsstudent.cmi.ua.ac.be/~pvelkeneers/blog/



Back to the top