Exe4J return Exception "?

1.1k Views Asked by At

I am using exe4j and I'm trying generate an exe file, after generated I try execute but does not work.

here the problem

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/joda/time/ReadableInstant
    at iguana.Principal.<init>(Principal.java:69)
    at iguana.Principal$32.run(Principal.java:1187)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.joda.time.ReadableInstant
    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)
    ... 16 more

Any idea?

2

There are 2 best solutions below

0
On

It looks like you are missing a joda-time class. My only thought might be that you are missing the library for it, which can be downloaded here: http://joda-time.sourceforge.net/ Or, if you use maven like me, add:

<dependency>
    <groupId>joda-time</groupId>
    <artifactId>joda-time</artifactId>
    <version>2.0</version>
</dependency>

to your POM file.

Hope this helps!

2
On

It looks like you left a library out of your executable. It can't find the org.joda.time package.

There are 2 probable solutions:

  1. If the library got left out, add it.
  2. If the library is already included, check that the classpath shows where it is.

Here is the exe4j help page that shows how to edit the classpath.