Jump to content
We've recently updated our Privacy Statement, available here ×

JR, Eclipse and java.exe


jeenajeena

Recommended Posts

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/JRException

Caused 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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 informations

Post edited by: jeenajeena, at: 2008/03/28 11:44

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...