Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

NoClassDefFoundError

alleyMar 6 2013 — edited Mar 7 2013
Good Morning,

I have created a jar file which works fine on my pc at home.

However, when I run it on another pc, it gives me this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/pdfbox/exc
eptions/InvalidPasswordException
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.getMethod0(Unknown Source)
        at java.lang.Class.getMethod(Unknown Source)
        at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.pdfbox.exceptions.Invali
dPasswordException
        at java.net.URLClassLoader$1.run(Unknown Source)
        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)
        ... 6 more
Do you know what could be the problem? Is it something to do with the classpath? And if yes, isn't a jar file supposed to run as a standalone program on every pc with jdk installed without needing to set classpath etc...?

Thanks for your help.
This post has been answered by gimbal2 on Mar 6 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 4 2013
Added on Mar 6 2013
5 comments
358 views