jeenajeena Posted March 26, 2008 Share Posted March 26, 2008 Hi, I'm having a problem (probably with CLASSPATH). I was able to compile and run a Java program to launch my JR reports, using Eclipse. The problem is: as long as I run the program with Eclipse, everything is ok. When I try with java Prog I obtain Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/JRExceptionCaused by: java.lang.ClassNotFoundException: net.sf.jasperreports.engine.JRException 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) I think included in CLASSPATH everything listed in Eclipse (and I already googled like a crazy, trying all the proposed solutions). Do you have any suggestions? Link to comment Share on other sites More sharing options...
jeenajeena Posted March 26, 2008 Author Share Posted March 26, 2008 Thanks for the help ;) Fortunately, I was able to solve it. The solution is: - always include the directory containing your main class file in CLASSPATH- you have to specify JARs' full path (including filenames) in CLASSPATH: directory name is not enough I guess this was obvious for any Java programmers. Unluckly I come from C#, so everything was new. If you're a C# developer approaching to JR, please, keep in touch, we could share informationsPost edited by: jeenajeena, at: 2008/03/28 11:44 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now